Ch 7 Linux Utilities Quiz Flashcards

1
Q

Use this command to display only unique lines in a file. Enter only the command without any arguments.

A

uniq

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

Use this command to display the first 10 lines of a text file. Enter only the name of the command, without any command arguments.

A

head

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

You want to remane a file named file1 to file2. Select the command.

a) rename file1 file2
b) rename file2 file1
c) mv file2 file1
d) mv file1 file2

A

d) mv file1 file2

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

Use this command to list directory contents. Enter only the command without any arguments. For example, name of the command was hello, enter hello.

A

ls

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

Use this command to display the last 10 lines of a text file. Enter only the name of the command, without any arguments.

A

tail

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

When using the Linux shelll, select the ONE item below that is an error.

a) echo hello world
b) ECHO HELLO WORLD
c) echo HELLO WORLD
e) echo “hello world”

A

b) ECHO HELLO WORLD

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

Use this command to remove a fiile. Enter only the name of the command, without any arguments.

A

rm

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

You need to determine the file type of a file named hello. Select the command.

a) file hello
b) which hello
c) type hello
d) filetype hello

A

a) file hello

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

Use this command to concatenate files. Enter only the name of the command, without any command-line arguments.

A

cat

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

Use this command to display the current date/time on your Linux system. Enter only the command.

A

date

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

Use this character to pipe the output of one command to the input of another command.

a) *
b) |
c) /
d) =

A

b) |

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

Use this command to print the currentn working directory. Enter only the name of the command, without any arguments.

A

pwd

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

Use this command to sort lines of text files. Enter only the name of the command, without any command arguments.

A

sort

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

Use this command to dispaly your hostname. Enter only the command, without any comand-line arguments.

A

hostname

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

Select ALL the items that are TRUE as related to the grep command.

a) The grep command comes from the terms “Global, Regular Expression, Print”.
b) Use grep to display lines matching a pattern.
c) None of the answers listed are true.
d) The grep command is used for group express printing.

A

a) The grep command comes from the terms “Global, Regular Expression, Print”.
b) Use grep to display lines matching a pattern.

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

Use this command to change to another directory. Enter only the name of the command, without any arguments.

A

cd

17
Q

Use this command to remove a directory. Enter only the name of the command, without any arguments.

A

rmdir

18
Q

You want to copy a file named source-file to a file name dest-file. Select the command.

a) copy dest-file source-file
b) cp dest-file source-file
c) cp source-file dest-file
d) copy source-file dest-file

A

c) cp source-file dest-file

19
Q

Select ALL items below that are TRUE as related to the less command.

a) When using less, use the / key to search for pattern. For example, enter /hello to look for the pattern hello in a text file displayed using less.
b) When using less, use the keyboard Page Up/Page Down keys to go forward/back.
c) Use less to display text files a screen at a time.
d) When using less, press “q” to quit.

A

a) When using less, use the / key to search for pattern. For example, enter /hello to look for the pattern hello in a text file displayed using less.
b) When using less, use the keyboard Page Up/Page Down keys to go forward/back.
c) Use less to display text files a screen at a time.
d) When using less, press “q” to quit.

20
Q

Use this command to make a directory. Enter only the name of the command, without any arguments.

A

mkdir

21
Q

Select ALL of the following that are TRUE about the use of quotes with the Linux shell.

a) Use ‘…’ (single quote) for no shell substitution.
b) Use ... (tick mark) for shell to execute command in the quote, and place results inside the quote.
c) Use “…” (double quotes) for shell substitution.
d) Use ‘…’ (single quote) for shell substitution

A

a) Use ‘…’ (single quote) for no shell substitution.
b) Use ... (tick mark) for shell to execute command in the quote, and place results inside the quote.
c) Use “…” (double quotes) for shell substitution.

22
Q

Use this command to compare two text files line by line. Enter only the command, without any command-line arguments.

A

diff

23
Q

Use this command to record a terminal session. Enter only the command without any arguments.

A

script

24
Q

On Linux, creating tar files is a popular way to archive a complete directory structure into a single archive file.

True
False

A

True

25
Q

Select ALL your choices for compressing and archiving files on Linux.

a) gzip
b) zip
c) bzip2
d) tar

A

a) gzip
b) zip
c) bzip2
d) tar