ExamGecko
Home Home / LPI / 101-500

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

Question list
Search
Search

List of questions

Search

CORRECT TEXT

Which command is used in a Linux environment to create a new directory? (Specify ONLY the command without any path or parameters.)

A.
mkdir,/usr/bin/mkdir
A.
mkdir,/usr/bin/mkdir
Answers
Suggested answer: A

Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.)

A.
find /tmp -uid root -print
A.
find /tmp -uid root -print
Answers
B.
find -path /tmp -uid root
B.
find -path /tmp -uid root
Answers
C.
find /tmp -user root -print
C.
find /tmp -user 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: C, D

When running the command sed -e "s/a/b/" /tmp/file >/tmp/file While /tmp/file contains data, why is /tmp/file empty afterwards?

A.
The file order is incorrect. The destination file must be mentioned before the command to ensure redirection.
A.
The file order is incorrect. The destination file must be mentioned before the command to ensure redirection.
Answers
B.
The command sed did not match anything in that file therefore the output is empty.
B.
The command sed did not match anything in that file therefore the output is empty.
Answers
C.
When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens itfor reading.
C.
When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens itfor reading.
Answers
D.
Redirection for shell commands do not work using the > character. It only works using the | character instead.
D.
Redirection for shell commands do not work using the > character. It only works using the | character instead.
Answers
Suggested answer: C

When given the following command line. echo "foo bar" | tee bar | cat Which of the following output is created?

A.
cat
A.
cat
Answers
B.
foo bar
B.
foo bar
Answers
C.
tee bar
C.
tee bar
Answers
D.
bar
D.
bar
Answers
E.
foo
E.
foo
Answers
Suggested answer: B

Which of the following commands can be used to determine how long the system has been running?

(Choose TWO correct answers.)

A.
uptime
A.
uptime
Answers
B.
up
B.
up
Answers
C.
top
C.
top
Answers
D.
uname -u
D.
uname -u
Answers
E.
time -up
E.
time -up
Answers
Suggested answer: A, C

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

A.
<
A.
<
Answers
B.
<<<
B.
<<<
Answers
C.
>
C.
>
Answers
D.
>>>
D.
>>>
Answers
E.
%>
E.
%>
Answers
Suggested answer: A, B, C

Which of the following explanations are valid reasons to run a command in the background of your shell?

A.
The command does not need to execute immediately.
A.
The command does not need to execute immediately.
Answers
B.
The command has to run immediately but the user needs to log out.
B.
The command has to run immediately but the user needs to log out.
Answers
C.
The system is being shut down and the command needs to restart execution immediately after the reboot.
C.
The system is being shut down and the command needs to restart execution immediately after the reboot.
Answers
D.
D.
Answers
Suggested answer: B

Explanation:

A. The command does not need to execute immediately.

B. The command has to run immediately but the user needs to log out.

C. The system is being shut down and the command needs to restart execution immediately after the reboot.

D. The command can run at a lower priority than normal commands run on the command line.

Answer: B

Explanation:

What does the + symbol mean in the following grep regular expression: grep '^d[aei]\+d$' /usr/share/dict/words

A.
Match the preceding character set ([aei]) one or more times.
A.
Match the preceding character set ([aei]) one or more times.
Answers
B.
Match the preceding character set ([aei]) zero or more times.
B.
Match the preceding character set ([aei]) zero or more times.
Answers
C.
Match the preceding character set ([aei]) zero or one times.
C.
Match the preceding character set ([aei]) zero or one times.
Answers
D.
Match a literal + symbol.
D.
Match a literal + symbol.
Answers
Suggested answer: A

While editing a file in vi, the file changes due to another process. Without exiting vi, how can the file be reopened for editing with the new content?

A.
:r
A.
:r
Answers
B.
:n
B.
:n
Answers
C.
:w
C.
:w
Answers
D.
:e
D.
:e
Answers
Suggested answer: D

You are trying to make a hard link to an ordinary file but ln returns an error. Which of the following could cause this?

A.
The source file is hidden.
A.
The source file is hidden.
Answers
B.
The source file is read-only.
B.
The source file is read-only.
Answers
C.
The source file is a shell script.
C.
The source file is a shell script.
Answers
D.
You do not own the source file.
D.
You do not own the source file.
Answers
E.
The source and the target are on different filesystems.
E.
The source and the target are on different filesystems.
Answers
Suggested answer: E
Total 246 questions
Go to page: of 25