Topic 3: The power of the command line Flashcards

1
Q

what command would you use to unpack this file: archive.tar?

A

tar xf archive.tar

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

what two utilities could be used to print the contents of a file to the screen?

A

cat and less

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

what is the format for a loop?

A

for i in { blank }; do echo $; done

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

what is a valid if statement?

A

if [ blank ]; then echo $; fi

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

what does an exit status of 1 indicate?

A

there was an error with the command

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

what does an exit status of zero indicate?

A

the command ran successfully

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

purpose of the command tar

A

create, update, list and extract archives. could also compress a group of files into an archive for backup

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

4 popular tools for compression

A

gzip, bzip, xz, and zip

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

what is the channel number for standard input?

A

channel zero

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

what is the channel number for standard output?

A

channel 1

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

what is the channel number for standard error?

A

channel 2

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

what is a bit bucket and an example?

A

a file that accepts input and doesn’t do anything with it.
example: /dev/null folder

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

what is the purpose of the command grep?

A

to search for a pattern or string

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

purpose of the command less

A

print contents of a file to the screen like man pages. user can scroll up and down a line at a time

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