LPI 101-500 practice test

LPIC-1 System Administrator Exam 101, Part 1 of 2,

Last exam update: Apr 10 ,2024
Page 1 out of 17. Viewing questions 1-15 out of 246

Question 1

Which of the following commands redirects the output of ls to standard error?

  • A. ls >-1
  • B. ls <<ERR
  • C. ls >&2
  • D. ls >>2
  • E. ls |error
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 2

Which wildcards will match the following filenames? (Choose two.)
ttyS0
ttyS1
ttyS2

  • A. ttyS[1-5]
  • B. tty?[0-5]
  • C. tty*2
  • D. tty[A-Z][012]
  • E. tty[Ss][02]
Answer:

B,D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 3

Which of the following files, located in a user’s home directory, contains the Bash history?

  • A. .bashrc_history
  • B. .bash_histfile
  • C. .history
  • D. .bash_history
  • E. .history_bash
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 4

What is true regarding the command
ls > files
if files does not exist?

  • A. The output of ls is printed to the terminal
  • B. files is created and contains the output of ls
  • C. An error message is shown and ls is not executed
  • D. The command files is executed and receives the output of ls
  • E. Any output of ls is discarded
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 5

When redirecting the output of find to the xargs command, what option to find is useful if the
filenames contain spaces?

  • A. –rep-space
  • B. -printnul
  • C. -nospace
  • D. –ignore-space
  • E. –print0
Answer:

E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 6

Which of the following commands displays the path to the executable file that would be executed
when the command foo is invoked?

  • A. lsattr foo
  • B. apropos foo
  • C. locate foo
  • D. whatis foo
  • E. which foo
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 7

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

  • A. fred fred
  • B. fred /home/fred/
  • C. ‘fred $USER’
  • D. fred $USER
  • E. ‘fred fred’
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8

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
  • B. foo | cp /tmp/foodata
  • C. foo > /tmp/foodata
  • D. foo | tee /tmp/foodata
  • E. foo > stdout >> /tmp/foodata
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 9

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

  • A. %s filea.txt
  • B. %w filea.txt
  • C. :save filea.txt
  • D. :w filea.txt
  • E. :s filea.txt
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 10

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/
  • B. s/txt/bak.txt/
  • C. s/txt$/bak.txt/
  • D. s/^txt$/.bak^/
  • E. s/[.txt]/.bak$1/
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 11

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
  • B. tr –c ‘\n\r’ ‘’ <newlist.txt> userlist.txt
  • C. tr ‘\r\n’ ‘’ <userlist.txt> newlist.txt
  • D. tr ‘\r’ ‘\n’ userlist.txt newlist.txt
  • E. tr –s ‘/^M/^J/’ userlist.txt newlist.txt
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

CORRECT TEXT
Which program runs a command in specific intervals and refreshes the display of the programs
output? (Specify ONLY the command without any path or parameters.)

Answer:

watch

User Votes:
Discussions
vote your answer:
0 / 1000

Question 13

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
  • B. dbmaint &>/dev/pts/null
  • C. nohup dbmaint &
  • D. bg dbmaint
  • E. wait dbmaint
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 14

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

  • A. d2
  • B. 2d
  • C. 2dd
  • D. dd2
  • E. de12
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 15

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

  • A. <
  • B. #>
  • C. %>
  • D. >>>
  • E. 2>&1
Answer:

A,E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000
To page 2