linux awk
This section contains Aptitude Questions and Answers on Linux AWK.
本节包含有关Linux AWK的“能力问题”。
AWK is a scripting language, which is used to perform operations on data and generate reports.
The compilation is not required for AWK programs.
The compilation is required for AWK programs.
We can use logical operators, string functions, and numeric functions in AWK programs.
Options:
Correct answer: 3
A, B, and D
Statements A, B, and D are correct about AWK in the Linux operating system.
AWK是一种脚本语言,用于对数据执行操作并生成报告。
AWK程序不需要编译。
AWK程序需要编译。
我们可以在AWK程序中使用逻辑运算符,字符串函数和数字函数。
选项:
正确答案:3
A,B和D
关于Linux操作系统中的AWK,语句A,B和D是正确的。
Correct answer: 3
Aho Weinberger Kernighan
The AWK stands for Aho Weinberger Kernighan. The Aho, Weinberger, and Kernighan are the AWK developers.
正确答案:3
Aho Weinberger Kernighan
AWK代表Aho Weinberger Kernighan。 Aho,Weinberger和Kernighan是AWK开发人员。
We can scan a file line by line using AWK.
It is used to transform data files.
It is used to perform operations on matched lines.
We can produce formatted reports using AWK.
Options:
Correct answer: 4
A, B, C, and D
All given statements are correct about AWK.
我们可以使用AWK逐行扫描文件。
它用于转换数据文件。
用于在匹配的行上执行操作。
我们可以使用AWK生成格式化的报告。
选项:
正确答案:4
A,B,C和D
所有给定的陈述都是正确的。
Correct answer: 1
awk '/school/ {print}' abc.txt
The 1st command is correct to print only those lines that contain "school" using AWK.
正确答案:1
awk'/ school / {print}'abc.txt
使用AWK仅打印包含“ school”的行的第一命令是正确的。
FS
OFS
KFS
ORS
Options:
Correct answer: 3
A, B, and D
Options A, B, and D are the correct inbuilt variable in AWK.
FS
OFS
肯德基
ORS
选项:
正确答案:3
A,B和D
选项A,B和D是AWK中正确的内置变量。
Correct answer: 3
FN
The "FN" is not a valid inbuilt variable in AWK.
Correct answer: 2
awk '{print NR,$0}' abc.txt
The 2nd command is correct to print all complete lines with line numbers using AWK.
正确答案:2
awk'{print NR,$ 0}'abc.txt
第二个命令使用AWK打印带有行号的所有完整行是正确的。
Correct answer: 1
awk 'NR==2, NR==4 {print NR,$0}' <filename>
The 1st command is correct to print lines from 2 to 4.
正确答案:1
awk'NR == 2,NR == 4 {print NR,$ 0}'<文件名>
第一条命令正确打印2到4行。
Correct answer: 1
awk 'NF > 0' <filename>
The 1st command is used to print non-empty line. Because the NF variable denotes number of fields in the file.
正确答案:1
awk'NF> 0'<文件名>
第一个命令用于打印非空行。 因为NF变量表示文件中的字段数。
Correct answer: 3
awk 'END { print NR }' <filename>
The 3rd option is correct, because -12 describes, it do not display 1st and 2nd column.
正确答案:3
awk'END {print NR}'<文件名>
第三个选项是正确的,因为-12描述,所以它不显示第一列和第二列。
Correct answer: 2
awk '{print $2} <filename>
正确答案:2
awk'{print $ 2} <文件名>
Correct answer: 4
Output Field Separator
The "OFS" stands for "Output Field Separator".
Correct answer: 3
~
The tilde is known as a match operator in AWK.
Correct answer: 2
FILENAME
The FILENAME variable contains the name of the specified file in the AWK command.
Correct answer: 1
Output Record Separator
The "ORS" stands for "Output Record Separator".
翻译自: https://www.includehelp.com/linux/awk-aptitude-questions-and-answers.aspx
linux awk