Quiz 2 Flashcards

1
Q

If you saw the following prompt, what USER was logged into the machine?

it244gh@vm75:/courses/it244/s19/ghoffman$

A

it244gh

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

If you saw the following prompt, what was the HOSTNAME of the machine?

it244gh@vm75:/courses/it244/s19/ghoffman$

A

vm75

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

If you saw the following prompt, what is your CURRENT DIRECTORY?

it244gh@vm75:/courses/it244/s19/ghoffman$

A

/courses/it244/s19/ghoffman

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 red_sox.txt that had the word “Win”, but NOT the word “Rays”?

A

grep Win red_sox.txt | grep -v Rays

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 your wanted to find all lines in the file red_sox.txt that had the word “Win”, but NOT the word “Rays”, and have the lines sorted alphabetically?

A

grep Win red_sox.txt | grep -v Rays | sort

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

What command would you use to find the date and time?

A

date

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

What program would you use to find where the program file for tar is located?

A

which or whereis

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 find all files with “link” as part of their name?

A

locate link

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

What command would you use to find out all the users currently logged on to the machine you are using?

A

finger or who

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

What would you type at the command line if you wanted to find out all you could about the user with account name wombat?

A

finger wombat

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

What would you type at the command line if you wanted to see the value of the variable SHELL?

A

echo $SHELL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
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
14
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
15
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
16
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

17
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

18
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

19
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

20
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