Class 5 Quiz Flashcards

1
Q

What would you type at the command line if you wanted to know the network name of the Unix computer you were using?

A

hostname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name one of the two pager programs that allow you to read a long file one screenful at a time.

A

more or less

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you started typing the name of a file on the command line and wanted Unix to supply the rest, what would you do?

A

hit the Tab key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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”?

A

grep homework results.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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”?

A

grep -v homework results.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What would you type at the command line if you wanted to see the first 10 lines of the file log.txt?

A

head log.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What would you type at the command line if you wanted to see the last 10 lines of the file log.txt?

A

tail log.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What would you type at the command line if you wanted to see all the lines in the file results.txt in sorted order?

A

sort results.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What would you type at the command line if you wanted to see all the lines in numbers.txt sorted in reverse numeric order?

A

sort -nr numbers.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly