Chapter-1 (Accessing The Command Line)
Chapter-1 (Accessing The Command Line)
A. Ext3
B. Ext4
C. XFS
D. Btrfs
ANSWER: C
When installing a server that uses LVM logical volumes, you’ll get at least three
storage volumes (partitions or LVM). Which of the following is not part of them?
A. /boot
B. /var
C. /
D. swap
ANSWER: B
The hardware display and keyboard used to interact with a system is called:
A. physical console
B. virtual console
C. terminal
D. None of the above
ANSWER: A
An interface that provides a display for output and a keyboard for input to a shell
session.
A. physical console
B. virtual console
C. shell prompt
D. terminal
ANSWER: D
The part of the command line that adjusts the behavior of a command.
A. command
B. option
C. argument
D. None of the above
ANSWER: B
The part of the command line that specifies the target that the command should
operate on.
A. command
B. option
C. argument
D. None of the above
ANSWER: C
The name of a program to run is called
A. command
B. option
C. argument
D. None of the above
ANSWER: A
The visual cue that indicates an interactive shell is waiting for the user to type
a command.
A. physical console
B. virtual console
C. Prompt
D. terminal
ANSWER: C
One of multiple logical consoles that can each support an independent login
session.
A. physical console
B. virtual console
C. shell prompt
D. terminal
ANSWER: B
Which environment variable allows you to retrieve the numeric user ID value for the
user account running a shell script?
A. $USER
B. $UID
C. $BASH
D. $HOME
E. $1
ANSWER: B
On Linux systems, which file typically now points to a shell program instead of
holding a shell program?
A. /bin/bash
B. /bin/dash
C. /bin/zsh
D. /bin/sh
E. /bin/tcsh
ANSWER: D
You have a lengthy file named FileA.txt. What will the head -15 FileA.txt command
do?
A. Display all but the last 15 lines of the file
B. Display all but the first 15 lines of the file
C. Display the first 15 lines of the file
D. Display the last 15 lines of the file
E. Generate an error message
ANSWER: C
You are trying to peruse a rather large text file. A co-worker suggests you use a
pager. Which of the following best describes what your co-worker is recommending?
A. Use a utility that allows you to view the first few lines of the file.
B. Use a utility that allows you to view one text page at time.
C. Use a utility that allows you to search through the file.
D. Use a utility that allows you to filter out text in the file.
E. Use a utility that allows you to view the last few lines of the file.
ANSWER: B
The cat -E MyFile.txt command is entered and at the end of every line displayed is
a $. What does this indicate?
A. The text file has been corrupted somehow.
B. The text file records end in the ASCII character NUL.
C. The text file records end in the ASCII character LF.
D. The text file records end in the ASCII character $.
E. The text file records contain a $ at their end.
ANSWER: C
A user has created a script with the name myscript. He tries to run it using the
command myscript, but it is not started. The user has verified that the script
permissions are set as executable. Which of the following is the most likely
explanation?
A. An internal command is preventing the startup of the script.
B. Users are not allowed to run scripts.
C. The directory that contains the script is not in the PATH.
D. The script does not have appropriate permissions.
ANSWER: C
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 for jumping to the beginning of the
previous word on the command line.
A. Ctrl + Left Arrow
B. Ctrl + Right Arrow
C. Ctrl + r
D. Esc + .
ANSWER: A
Which command line-editing shortcut can be used for jumping to the beginning of the
next word on the command line.
A. Ctrl + Left Arrow
B. Ctrl + Right Arrow
C. Ctrl + r
D. Esc + .
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
Which command line-editing shortcut can be used to search the history list of
commands for a pattern?
A. Ctrl + Left Arrow
B. Ctrl + Right Arrow
C. Ctrl + r
D. Esc + .
ANSWER: C
Which command line-editing shortcut can be used to separate commands on the same
line.
A. ;
B. !string
C. !number
D. Esc + .
ANSWER: A
Which command line-editing shortcut can be used to complete commands, file names,
and options.
A. ;
B. !string
C. !number
D. Tab
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 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