Process text streams using filters (2) Flashcards
Objective 103.2 Weight 2
What of the following commands can you enter to display the first 8 lines of the /etc/passwd file?
- head /etc/passwd
- head -8 /etc/passwd
- head -n 8 /etc/passwd
- head /etc/passwd -8
- head 8 /etc/passwd
2. head -8 /etc/passwd
AND
3. head -n 8 /etc/passwd
By default the head command displays the first ten lines of a text file. To see a different number of lines, such as 8 lines, you need to use either the -n 8 option or the -8 option on the head command.
You want to display the number of bytes in the text file, test.txt. Which of the following commands will accomplish that?
- wc test.txt
- wc -c test.txt
- wc -l test.txt
- wc -w test.txt
- wc -b test.txt
- wc test.txt
AND - wc -c test.txt
Both the wc -c test.txt and the wc test.txt will show the number of bytes in the test.txt file. However, wc test.txt will also display the number of lines and words in the file as well.
Which of the following hash utilities produce the longest hash?
- md5sum
- md512sum
- hash
- sha256sum
- sha512sum
- sha512sum
The sha512sum produces the longest hash (two of the listed utilities are fake, and are not true hash utilities.)