Home »
Aptitude Questions and Answers »
Linux Aptitude Questions and Answers
Linux Filter Commands Aptitude Questions and Answers
Linux Filter Commands Aptitude Questions and Answers: This section contains aptitude questions and answers on Linux Filter Commands.
Submitted by Nidhi, on May 04, 2020
This section contains Aptitude Questions and Answers on Linux Filter Commands.
1) There are the following statements that are given below which of them are correct about piping in the Linux operating system?
- The piping the process which is used to redirect the output of one command to another command as an input.
- We use the pipe (|) operator to perform piping.
- The piping is not supported in Linux; it works only in the UNIX operating system.
- None of the above
Options:
- Only A
- Only B
- A and B
- A and C
Correct answer: 3
A and B
Statements A and B are correct about piping in the Linux operating system.
2) There are the following statements that are given below which of them are correct about cut command?
- The cut command is used to select a specific column of a file.
- We can use a delimiter in the cut command to separate the columns of a file.
- We cannot use a delimiter in the cut command.
- The cut command is used to move files from one location to another location.
Options:
- Only A
- Only B
- A and B
- A and C
Correct answer: 3
A and B
Statements A and B are correct about the cut command.
3) In the cut command, a delimiter can be?
- Hyphen
- Space
- Slash
- All of the above
Options:
- A
- B
- C
- D
Correct answer: 4
D
A delimiter can be a hyphen, space, and slash.
4) Which of the following option is used to mention delimiter in the cut command?
- -del
- -d
- -delmiter
- -delm
Correct answer: 2
-d
The "-d" option is used to mention delimiter in the cut command.
5) Which of the following statements are the correct about grep command?
- This command is used to filter the content of the file.
- This command is not used to filter the content of the file.
- We can search the specified word in the file using grep command.
- There is no grep command that exists in the Linux operating system.
Options:
- Only A
- Only A
- A and B
- A and C
Correct answer: 4
A and C
Statements A and C are correct about grep command.
6) The grep stands for?
- Global Regular Expression Print
- General Regular Expression Pegging
- General Regular Expression Post
- Global Regular Expression Post
Correct answer: 1
Global Regular Expression Print
The "grep" stands for "Global Regular Expression Print".
7) Which exact command is used to print lines of the file that are not matching to the specific word?
- grep -v <specific word> <filename>
- grep -i <specific word> <filename>
- grep -k <specific word> <filename>
- grep -n <specific word> <filename>
Correct answer: 1
grep -v <specific word> <filename>
The 1st statement is correct command to print lines of the file that are not matching to the specific word.
8) Which of the following option is used in grep command to search specific words from a file by ignoring case?
- -a
- -i
- -c
- -ing
Correct answer: 2
-i
The "-i" option is used to ignore the case for searching a word in a file.
9) Which of the following statements are the correct about XXXcomm command?
- The comm command is used to compare the data of two files.
- It displays three columns in the output by default.
- It displays two columns in the output by default.
- The comm command is used to communicate with the TCP socket.
Options:
- A
- B
- A and B
- C and D
Correct answer: 3
A and B
Statements A and B are correct about comm command in the Linux operating system.
10) Which exact command is used to display only matched data of two files?
- comm -13 <file1> <file2>
- comm -23 <file1> <file2>
- comm -12 <file1> <file2>
- None of the above
Correct answer: 3
comm -12 <file1> <file2>
The 3rd option is correct, because -12 describes, it do not display 1st and 2nd column.
11) Which of the following statements are the correct about XXXsed command?
- The sed command is used to display modified data on the console screen, actual data in the file remain the same.
- The sed command is used to modify the data of a file permanently.
- The regular expressions are used to display modified data of a file in the sed command.
- The sed command does not use regular expressions.
Options:
- A and C
- A and D
- B and C
- B and D
Correct answer: 1
A and C
Statements A and C are correct about sed command in the Linux operating system.
12) In Linux, the sed stands for?
- String Editor
- Stream Editor
- Simple Editor
- Single Editor
Correct answer: 2
Stream Editor
The "sed" stands for Stream Editor in the Linux Operating System.
13) Which option is used in the regular expression to remove a complete line from the output of a file using "sed" command?
- zcat
- zmore
- zless
- zgip
Options:
- d
- del
- delete
- rem
Correct answer: 1
d
Option "d" is used in the regular expression to remove a complete line from the output of a file using sed command.
14) Which command is used to read data from the standard input device and write to the standard output and one or more files?
- tea
- tei
- tie
- tee
Correct answer: 4
tee
The tee command is the correct answer.
15) Can we display the output of a file where all '\n' (newline) character are replaced by space?
- Yes
- No
Correct answer: 1
Yes
Yes, we can do this using the "tr" command.
16) Is it true that we can display the output of a file, where all small specified sets of characters are replaced by capital characters or vice versa using the "tr" command?
- Yes
- No
Correct answer: 1
Yes
Yes, we can do this using the "tr" command.
17) Which of the following statements are the correct about XXXuniq command?
- This command is used to delete unique data from a file permanently.
- This command is used to display a sorted list in which every word will occur only once.
- We can count the occurrence of a word using uniq command.
- None of the above
Options:
- A and B
- A and C
- B and C
- B and D
Correct answer: 3
B and C
Statements B and C are correct about uniq command.
18) Which of the following statements are the correct about XXXwc command?
- This command is used to count the lines of a file.
- This command is used to count the words of a file.
- This command is used to count the characters of a file.
- All the above.
Options:
- A and B
- A and C
- B and C
- D
Correct answer: 4
D
All statements are correct about "wc" command.
19) Which of the following statements are the correct about XXXod command?
- This command is used to display the content of the file in octal format.
- This command is used to display the content of the file in hexadecimal format.
- This command is used to display the content of the file in ASCII format.
- All the above.
Options:
- A and B
- A and C
- B and C
- D
Correct answer: 4
D
All statements are correct about od command.
20) Which of the following statements are the correct about XXXsort command?
- This command is used to sort the content of a file in alphabetical order.
- This command is used to sort the content of a file based on the column.
- This command is used for numeric sorting bases on the column.
- None of the Above.
Options:
- A and B
- A and C
- A, B, and C
- D
Correct answer: 3
A, B, and C
Statements A, B, and C are correct about sort command.
21) Which option is used in sort command, if we want to sort the content of the file based on a specific column number?
- -c
- -k
- -n
- -f
Correct answer: 2
-k
The option "-k" is used to specify the column number for sorting the content of a file.
22) Which command is used to compress a file?
- zip
- gzip
- ezip
- mzip
Correct answer: 2
gzip
The "gzip" command is used to compress a file.
23) How can we see the compression ratio of a file?
- Using -c option of gzip command
- Using -r option of gzip command
- Using -l option of gzip command
- Using -cr option of gzip command
Correct answer: 3
Using -l option of gzip command
The option "-l" of "gzip" command is used to see the compression ratio of a file.
24) Can we compress a directory using gzip command?
- Yes
- No
Correct answer: 2
No
No, we cannot compress a directory using gzip command.
25) Which of the following command is used to compress a directory?
- gzip
- dzip
- tar
- rat
Correct answer: 3
tar
The "tar" command is used to compress a directory.