Class 5 Quiz Flashcards
What would you type at the command line if you wanted to know the network name of the Unix computer you were using?
hostname
Name one of the two pager programs that allow you to read a long file one screenful at a time.
more or less
If you started typing the name of a file on the command line and wanted Unix to supply the rest, what would you do?
hit the Tab key
What would you type at the command line if you wanted to find all lines in the file results.txt that contained the word “homework”?
grep homework results.txt
What would you type at the command line if you wanted to find all lines in the file results.txt that did not contain the word “homework”?
grep -v homework results.txt
What would you type at the command line if you wanted to see the first 10 lines of the file log.txt?
head log.txt
What would you type at the command line if you wanted to see the last 10 lines of the file log.txt?
tail log.txt
What would you type at the command line if you wanted to see all the lines in the file results.txt in sorted order?
sort results.txt
What would you type at the command line if you wanted to see all the lines in numbers.txt sorted in reverse numeric order?
sort -nr numbers.txt