16.
Which command was developed to show only the first 10 lines in a text file?
- A.head
- B.top
- C.first
- D.cat
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The head command by default shows the first 10 lines in a text file. |
17.
Which command enables you to count the number of words in a text file?
- A.count
- B.list
- C.ls -l
- D.wc
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
The wc command shows the number of lines, words, and characters in a file. |
18.
Which key on your keyboard do you use in less to go to the last line of the
current text file?
- A.End
- B.PageDown
- C.q
- D.G
- Answer & Explanation
- Report
Answer : [D]
Explanation :
Explanation :
When using less, the G key brings you to the end of the current file. |
19.
Which option is missing from the following command, assuming that you
want to filter the first field out of the /etc/passwd file and assuming that the
character that is used as the field delimiter is a:? cut .... : -f 1 /etc/passwd
- A.-d
- B.-c
- C.-t
- D.-x
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The -d option is used to specify the field delimiter that needs to be used to distinguish different fields in files while using cut . |
20.
Which option is missing if you want to sort the third column of the output of
the command ps aux ?
ps aux | sort ...
ps aux | sort ...
- A.-k3
- B.-s3
- C.-k f 3
- D.-f 3
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
The sort command can sort files or command output based on specific keys. If no specific key is mentioned, sorting happens based on fields. The option -k3 will therefore sort the third field in the output of the ps aux command. |