0% found this document useful (0 votes)
146 views7 pages

Chapter-1 (Accessing The Command Line)

The document contains questions and answers related to Linux commands, file systems, shells, and shell scripting. It covers topics such as the default file system in RHEL 8 (XFS), features supported by different file systems (Ext4 supports shrinking but XFS does not), components of an LVM storage volume installation (/boot, /, swap but not /var), shells and shell scripts.

Uploaded by

Kyar Nyo Aye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views7 pages

Chapter-1 (Accessing The Command Line)

The document contains questions and answers related to Linux commands, file systems, shells, and shell scripting. It covers topics such as the default file system in RHEL 8 (XFS), features supported by different file systems (Ext4 supports shrinking but XFS does not), components of an LVM storage volume installation (/boot, /, swap but not /var), shells and shell scripts.

Uploaded by

Kyar Nyo Aye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Which is the default file system that is used in RHEL 8?

A. Ext3
B. Ext4
C. XFS
D. Btrfs
ANSWER: C

Which feature is supported in Ext4 but not in XFS?


A. Shrinking the file system
B. Snapshots
C. File system quota
D. A maximum size that goes beyond 2 TB
ANSWER: A

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

When a shell is used interactively, it displays a string when it is waiting for a


command from the user. This is called the _________.
A. physical console
B. virtual console
C. shell prompt
D. terminal
ANSWER: C

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 interpreter that executes commands typed as strings.


A. physical console
B. virtual console
C. shell
D. terminal
ANSWER: C

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 of the following are names of shell programs?


A. Bash
B. Korn Shell
C. Dash
D. Z Shell
E. All of the above
ANSWER: E

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

Which of the following does not describe the less utility?


A. It does not read the entire file prior to displaying the file’s first page.
B. You can use the up and down arrow keys to move through the file.
C. You press the spacebar to move forward a page.
D. You can use the Esc+V key combination to move backward a page.
E. You can press the X key to exit from the utility.
ANSWER: E

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 Unicode-encoded text file, MyUCode.txt, needs to be perused. Before you decide


what utility to use in order to view the file’s contents, you employ the wc command
on it. This utility displays 2020 6786 11328 to STDOUT. What of the following is
true?
A. The file has 2,020 lines in it.
B. The file has 6,786 words in it.
C. The file has 11,328 bytes in it.
D. All of the above
ANSWER: D

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

For which of the following items can bash completion be used?


A. Commands
B. Files
C. Variables
D. All of the above
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 re-execute a specific command in


the history list.
A. ;
B. !string
C. !number
D. Esc + .
ANSWER: C

Which command line-editing shortcut can be used to re-execute a recent command by


matching the command name.
A. ;
B. !string
C. !number
D. Esc + .
ANSWER: B

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

The _________ command displays a list of previously executed commands prefixed


with a command number.
A. history
B. find
C. search
D. execute
ANSWER: A

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

You might also like