101-500 : LPIC-1 Exam 101 : Part 03
-
FILL BLANK
Which program runs a command in specific intervals and refreshes the display of the program’s output? (Specify ONLY the command without any path or parameters.)
-
watch
-
-
Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the deleted content below the current line?
- i (lowercase)
- p (lowercase)
- P (uppercase)
- U (uppercase)
- u (lowercase)
-
Which of the following commands changes all CR-LF line breaks in the text file
userlist.txt
to Linux standard LF line breaks and stores the result innewlist.txt?
-
tr –d ‘\r’ < userlist.txt > newlist.txt
-
tr –c ‘\n\r’ ‘’ <newlist.txt> userlist.txt
-
tr ‘\r\n’ ‘’ <userlist.txt> newlist.txt
-
tr ‘\r’ ‘\n’ userlist.txt newlist.txt
-
tr –s ‘/^M/^J/’ userlist.txt newlist.txt
-
-
Given the following input stream:
txt1.txt atxt.txt txtB.txt
Which of the following regular expressions turns this input stream into the following output stream?
txt1.bak.txt atxt.bak.txt txtB.bak.txt
-
s/^.txt/.bak/
-
s/txt/bak.txt/
-
s/txt$/bak.txt/
-
s/^txt$/.bak^/
-
s/[.txt]/.bak$1/
-
-
Which command must be entered before exiting vi to save the current file as
filea.txt?
-
%s filea.txt
-
%w filea.txt
-
:save filea.txt
-
:w filea.txt
-
:s filea.txt
-
-
Which of the following signals is sent to a process when the key combination Ctrl+C is pressed on the keyboard?
- SIGTERM
- SIGCONT
- SIGSTOP
- SIGKILL
- SIGINT
-
Which of the following commands displays the output of the foo command on the screen and also writes it to a file called
/tmp/foodata?
-
foo | less /tmp/foodata
-
foo | cp /tmp/foodata
-
foo > /tmp/foodata
-
foo | tee /tmp/foodata
-
foo > stdout >> /tmp/foodata
-
-
What output will be displayed when the user
fred
executes the following command?echo
‘fred $USER’
-
fred fred
-
fred /home/fred/
-
‘fred $USER’
-
fred $USER
-
‘fred fred’
-
-
Which of the following commands displays the path to the executable file that would be executed when the command
foo
is invoked?-
lsattr foo
-
apropos foo
-
locate foo
-
whatis foo
-
which foo
-
-
When redirecting the output of find to the
xargs
command, what option to find is useful if the filenames contain spaces?-
–rep-space
-
-printnul
-
-nospace
-
–ignore-space
-
–print0
-
-
Which of the following commands can be used to determine how long the system has been running? (Choose two.)
-
uptime
-
up
-
time --up
-
uname –u
-
top
-
-
What is true regarding the command
ls > files
if
files
does not exist?- The output of
ls
is printed to the terminal files
is created and contains the output ofls
- An error message is shown and
ls
is not executed - The command
files
is executed and receives the output ofls
- Any output of
ls
is discarded
- The output of
-
Which of the following files, located in a user’s home directory, contains the Bash history?
-
.bashrc_history
-
.bash_histfile
-
.history
-
.bash_history
-
.history_bash
-
-
Which wildcards will match the following filenames? (Choose two.)
ttyS0 ttyS1 ttyS2
-
ttyS[1-5]
-
tty?[0-5]
-
tty*2
-
tty[A-Z][012]
-
tty[Ss][02]
-
-
Which of the following commands redirects the output of
ls
to standard error?-
ls >-1
-
ls <<ERR
-
ls >&2
-
ls >>2
-
ls |error
-
-
Which of the following commands displays the contents of a gzip compressed tar archive?
-
gzip archive.tgz | tar xvf -
-
tar –fzt archive.tgz
-
gzip –d archive.tgz | tar tvf -
-
tar cf archive.tgz
-
tar ztf archive.tgz
-
-
Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the
/etc/passwd
file?-
fmt –f 1,4 /etc/passwd
-
cut –d : -f 1,4 /etc/passwd
-
sort –t : -k 1,4 /etc/passwd
-
paste –f 1,4 /etc/passwd
-
split –c 1,4 /etc/passwd
-
-
Which of the following regular expressions represents a single upper-case letter?
- :UPPER:
- [A-Z]
- !a-z
- %C
- {AZ}
-
FILL BLANK
Which command is used to start another command with a given nice level? (Specify ONLY the command without any path or parameters.)
-
nice
-
-
Given a log file
loga.log
with timestamps of the formatDD/MM/YYYY:hh:mm:ss,
which command filters out all log entries in the time period between 8:00 am and 8:59 am?-
grep –E ‘:08:[09]+:[09]+’ loga.log
-
grep –E ‘:08:[00]+’ loga.log
-
grep –E loga.log ‘:08:[0-9]+:[0-9]+’
-
grep loga.log ‘:08:[0-9]:[0-9]’
-
grep –E ‘:08:[0-9]+:[0-9]+’ loga.log
-
Subscribe
0 Comments
Newest