ExamGecko
Home Home / LPI / 101-500

LPI 101-500 Practice Test - Questions Answers, Page 24

Question list
Search
Search

List of questions

Search

Which of the following commands list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root? (Choose two.)

A.
find /tmp -user root -print
A.
find /tmp -user root -print
Answers
B.
find -path /tmp -uid root
B.
find -path /tmp -uid root
Answers
C.
find /tmp -uid root -print
C.
find /tmp -uid root -print
Answers
D.
find /tmp -user root
D.
find /tmp -user root
Answers
E.
find -path /tmp -user root -print
E.
find -path /tmp -user root -print
Answers
Suggested answer: A, E

Which of the following are valid stream redirection operators within Bash? (Choose two.)

A.
<
A.
<
Answers
B.
#>
B.
#>
Answers
C.
%>
C.
%>
Answers
D.
>>>
D.
>>>
Answers
E.
2>&1
E.
2>&1
Answers
Suggested answer: A, E

Which of the following vi commands deletes two lines, the current and the following line?

A.
d2
A.
d2
Answers
B.
2d
B.
2d
Answers
C.
2dd
C.
2dd
Answers
D.
dd2
D.
dd2
Answers
E.
de12
E.
de12
Answers
Suggested answer: C

The command dbmaint & was used to run dbmaint in the background. However, dbmaint is terminated after logging out of the system. Which alternative dbmaint invocation lets dbmaint continue to run even when the user running the program logs out?

A.
job -b dmaint
A.
job -b dmaint
Answers
B.
dbmaint &>/dev/pts/null
B.
dbmaint &>/dev/pts/null
Answers
C.
nohup dbmaint &
C.
nohup dbmaint &
Answers
D.
bg dbmaint
D.
bg dbmaint
Answers
E.
wait dbmaint
E.
wait dbmaint
Answers
Suggested answer: D

CORRECT TEXT

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.)

A.
watch
A.
watch
Answers
Suggested answer: A

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 in newlist.txt?

A.
tr -d '\r' < userlist.txt > newlist.txt
A.
tr -d '\r' < userlist.txt > newlist.txt
Answers
B.
tr -c '\n\r' '' <newlist.txt> userlist.txt
B.
tr -c '\n\r' '' <newlist.txt> userlist.txt
Answers
C.
tr '\r\n' '' <userlist.txt> newlist.txt
C.
tr '\r\n' '' <userlist.txt> newlist.txt
Answers
D.
tr '\r' '\n' userlist.txt newlist.txt
D.
tr '\r' '\n' userlist.txt newlist.txt
Answers
E.
tr -s '/^M/^J/' userlist.txt newlist.txt
E.
tr -s '/^M/^J/' userlist.txt newlist.txt
Answers
Suggested answer: A

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

A.
s/^.txt/.bak/
A.
s/^.txt/.bak/
Answers
B.
s/txt/bak.txt/
B.
s/txt/bak.txt/
Answers
C.
s/txt$/bak.txt/
C.
s/txt$/bak.txt/
Answers
D.
s/^txt$/.bak^/
D.
s/^txt$/.bak^/
Answers
E.
s/[.txt]/.bak$1/
E.
s/[.txt]/.bak$1/
Answers
Suggested answer: B

Which command must be entered before exiting vi to save the current file as filea.txt?

A.
%s filea.txt
A.
%s filea.txt
Answers
B.
%w filea.txt
B.
%w filea.txt
Answers
C.
:save filea.txt
C.
:save filea.txt
Answers
D.
:w filea.txt
D.
:w filea.txt
Answers
E.
:s filea.txt
E.
:s filea.txt
Answers
Suggested answer: D

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?

A.
foo | less /tmp/foodata
A.
foo | less /tmp/foodata
Answers
B.
foo | cp /tmp/foodata
B.
foo | cp /tmp/foodata
Answers
C.
foo > /tmp/foodata
C.
foo > /tmp/foodata
Answers
D.
foo | tee /tmp/foodata
D.
foo | tee /tmp/foodata
Answers
E.
foo > stdout >> /tmp/foodata
E.
foo > stdout >> /tmp/foodata
Answers
Suggested answer: D

What output will be displayed when the user fred executes the following command? echo 'fred $USER'

A.
fred fred
A.
fred fred
Answers
B.
fred /home/fred/
B.
fred /home/fred/
Answers
C.
'fred $USER'
C.
'fred $USER'
Answers
D.
fred $USER
D.
fred $USER
Answers
E.
'fred fred'
E.
'fred fred'
Answers
Suggested answer: A
Total 246 questions
Go to page: of 25