Ch 7 Linux Utilities Quiz Flashcards
Use this command to display only unique lines in a file. Enter only the command without any arguments.
uniq
Use this command to display the first 10 lines of a text file. Enter only the name of the command, without any command arguments.
head
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
d) mv file1 file2
Use this command to list directory contents. Enter only the command without any arguments. For example, name of the command was hello, enter hello.
ls
Use this command to display the last 10 lines of a text file. Enter only the name of the command, without any arguments.
tail
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”
b) ECHO HELLO WORLD
Use this command to remove a fiile. Enter only the name of the command, without any arguments.
rm
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) file hello
Use this command to concatenate files. Enter only the name of the command, without any command-line arguments.
cat
Use this command to display the current date/time on your Linux system. Enter only the command.
date
Use this character to pipe the output of one command to the input of another command.
a) *
b) |
c) /
d) =
b) |
Use this command to print the currentn working directory. Enter only the name of the command, without any arguments.
pwd
Use this command to sort lines of text files. Enter only the name of the command, without any command arguments.
sort
Use this command to dispaly your hostname. Enter only the command, without any comand-line arguments.
hostname
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) The grep command comes from the terms “Global, Regular Expression, Print”.
b) Use grep to display lines matching a pattern.
Use this command to change to another directory. Enter only the name of the command, without any arguments.
cd
Use this command to remove a directory. Enter only the name of the command, without any arguments.
rmdir
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
c) cp source-file dest-file
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) 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.
Use this command to make a directory. Enter only the name of the command, without any arguments.
mkdir
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) 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.
Use this command to compare two text files line by line. Enter only the command, without any command-line arguments.
diff
Use this command to record a terminal session. Enter only the command without any arguments.
script
On Linux, creating tar files is a popular way to archive a complete directory structure into a single archive file.
True
False
True
Select ALL your choices for compressing and archiving files on Linux.
a) gzip
b) zip
c) bzip2
d) tar
a) gzip
b) zip
c) bzip2
d) tar