Professional Documents
Culture Documents
You need the output of the command ls to be used as input for the less command.
Which of the following examples will do that for you?
A. ls > less
B. ls >> less
C. ls >| less
D. ls | less
ANSWER: D
A user wants to remove his complete history. Which of the following approaches
would do that?
A. Remove the ~/.bash_history file and type history -c.
B. Type history -c.
C. Remove the ~/.bash_history file.
D. Type history -c and close the current shell.
ANSWER: A
Which of the following is not a valid method to repeat a command from history?
A. Use Ctrl+R and start typing a part of the command.
B. Use ! followed by the first letters in the command.
C. Use ! followed by the number of the command as listed in history.
D. Use Ctrl+X followed by the number in history.
ANSWER: D
Which command line-editing shortcut can be used for jumping to the beginning of the
command line?
A. Ctrl + a
B. Ctrl + e
C. Ctrl + u
D. Ctrl + k
ANSWER: A
Which command line-editing shortcut can be used for jumping to the end of the
command line?
A. Ctrl + a
B. Ctrl + e
C. Ctrl + u
D. Ctrl + k
ANSWER: B
Which command line-editing shortcut can be used to clear from the cursor to the
beginning of the command line?
A. Ctrl + a
B. Ctrl + e
C. Ctrl + u
D. Ctrl + k
ANSWER: C
Which command line-editing shortcut can be used to clear from the cursor to the end
of the command line?
A. Ctrl + a
B. Ctrl + e
C. Ctrl + u
D. Ctrl + k
ANSWER: D
Which command line-editing shortcut can be used to copy the last argument of
previous commands?
A. Ctrl + Left Arrow
B. Ctrl + Right Arrow
C. Ctrl + r
D. Esc + .
ANSWER: D
The _________ command scans the beginning of a file's contents and displays what
type it is.
A. scan
B. type
C. find
D. file
ANSWER: D
When a regular user starts a shell, the default prompt ends with a _________
character.
A. #
B. ~
C. $
D. !
ANSWER: C
How to display the current time in the following format: HH:MM:SS A/PM?
A. date +%r
B. date +%R
C. date +%x
D. date +%c
ANSWER: A
Which directory contains dynamic configuration data, such as FTP and websites?
A. /var
B. /usr
C. /tmp
D. /run
ANSWER: A
Under which directory would you expect to find nonessential program files?
A. /boot
B. /bin
C. /sbin
D. /usr
ANSWER: D
Which command enables you to show all files in the current directory so that the
newest files are listed last?
A. ls -lRt
B. ls -lrt
C. ls -alrt
D. ls -alr
ANSWER: C
Which command enables you to copy hidden files as well as regular files from /home/
$USER to the current directory?
A. cp -a /home/$USER .
B. cp -a /home/$USER/* .
C. cp -a /home/$USER/. .
D. cp -a home/$USER. .
ANSWER: C
The _________ command displays the full path name of the current location.
A. cd
B. ls
C. pwd
D. touch
ANSWER: C
A/An _________ is a fully qualified name, beginning at the root (/) directory and
specifying each subdirectory traversed to reach and uniquely represent a single
file.
A. absolute path
B. relative path
C. pwd
D. none of the above
ANSWER: A
A/An _________ identifies a unique file, specifying only the path necessary to
reach the file from the working directory.
A. absolute path
B. relative path
C. pwd
D. none of the above
ANSWER: B
Which command enables you to list the current user's home directory (long format)
in simplest syntax, when it is not the current location.
A. ls -l ~
B. ls -al
C. ls -cl
D. ls -il
ANSWER: A
Which command enables you to list the current location (long format) with hidden
files.
A. ls -l ~
B. ls -al
C. ls -cl
D. ls -il
ANSWER: B
Which command enables you to show the contents of the current directory, in
addition to all of its subdirectories.
A. ls -l
B. ls -a
C. ls -d
D. ls -R
ANSWER: D
Which command enables you to return to the current user's home directory.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: D
Which command enables you to return to the most previous working directory.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: A
Which command enables you to move up two levels from the current location.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: C
Which command enables you to move up to the parent of the current location.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: B
Which command enables you to move to the binaries location, from any current
location.
A. cd /bin
B. cd bin
C. cd
D. cd .
ANSWER: A
Which command enables you to move to the binaries location, from the root
directory.
A. cd /bin
B. cd bin
C. cd
D. cd .
ANSWER: B
The _________ command renames files in the same directory, or relocates files to a
new directory.
A. ren
B. rm
C. rn
D. mv
ANSWER: D
You are using man -k user, but you get the message “nothing appropriate.” Which of
the following solutions is most likely to fix this for you?
A. Type updatedb to update the man database.
B. Type makewhatis to update the man database.
C. Type mandb to update the man database.
D. Use man -K, not man -k.
ANSWER: C
Which command enables you to find the correct man page based on keyword usage?
A. man -f
B. man -w
C. man -l
D. man -k
ANSWER: D
What command enables you to display a list of current directory contents, where the
newest files are listed first?
A. ls -lRt
B. ls -lrt
C. ls -alrt
D. ls -alt
ANSWER: D
Which command enables you to wipe an entire directory structure, including all of
its contents?
A. rm -i /directory
B. rm -d /directory
C. rm -rf /directory
D. rm /directory
ANSWER: C
How would you copy all files that have a name that starts with a, b, or c from the
directory /etc to your current directory?
A. cp /etc/[abc]* .
B. cp /etc/[abc]? .
C. cp /etc/[abc]? ~
D. cp /etc/[abc]* ~
ANSWER: A
Which command was developed to show only the first 10 lines in a text file?
A. top
B. head
C. first
D. cat
ANSWER: B
Which command enables you to count the number of words in a text file?
A. count
B. list
C. ls -l
D. wc
ANSWER: D
Which key on your keyboard do you use in less to go to the last line of the current
text file?
A. End
B. PageDown
C. q
D. G
ANSWER: D
Which command enables you to show the last five lines from ~/samplefile?
A. tail -n 5 ~/samplefile
B. last -n 5 ~/samplefile
C. cat -n 5 ~/samplefile
D. less -n 5 ~/samplefile
ANSWER: A
After opening command output using tail -f ~/mylogfile, how do you stop showing
output?
A. Ctrl + A
B. Ctrl + B
C. Ctrl + C
D. Ctrl + D
ANSWER: C