LPI 010-160 practice test

Linux Essentials Certificate, version 1.6 Exam

Last exam update: Nov 16 ,2024
Page 1 out of 5. Viewing questions 1-15 out of 80

Question 1

Which of the following commands creates the ZIP archive poems.zip containing all files in the current
directory whose names end in .txt?

  • A. zip *.txt > poems.zip
  • B. zcat *.txt poems.zip
  • C. zip poems.zip *.txt
  • D. zip cfz poems.zip *.txt
  • E. cat *.txt | zip poems.zip
Answer:

C

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

Question 2

What is the return value of a shell script after successful execution?

  • A. 1
  • B. 0
  • C. -1
  • D. -255
  • E. 255
Answer:

B

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

Question 3

The file script.sh in the current directory contains the following content:
#!/bin/bash echo $MYVAR
The following commands are used to execute this script:
MYVAR=value
./script.sh
The result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set
in order to make script.sh display the content of MYVAR?

  • A. !MYVAR=value
  • B. env MYVAR=value
  • C. MYVAR=value
  • D. $MYVAR=value
  • E. export MYVAR=value
Answer:

E

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

Question 4

Which operator in a regular expression matches the preceding character either zero or one time?

  • A. ?
  • B. * C. +
  • D. %
  • E. $
Answer:

A

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

Question 5

Which of the following examples shows the general structure of a for loop in a shell script?

  • A. for *.txt as file => echo $file
  • B. for *.txt ( echo $i )
  • C. for file in *.txt do echo $i done
  • D. for ls *.txt exec {} \;
  • E. foreach @{file} { echo $i }
Answer:

C

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

Question 6

Which of the following commands puts the lines of the file data.csv into alphabetical order?

  • A. a..z data.csv
  • B. sort data.csv
  • C. abc data.csv
  • D. wc -s data.csv
  • E. grep --sort data.csv
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 7

Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?

  • A. copy /etc /root
  • B. cp -r /etc/* /root
  • C. cp -v /etc/* /root
  • D. rcp /etc/* /root
  • E. cp -R /etc/*.* /root
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 8

FILL IN THE BLANK
What command displays manual pages? (Specify ONLY the command without any path or
parameters.)

Answer:

man

User Votes:
Discussions
vote your answer:
0 / 1000

Question 9

Which of the following commands sets the variable USERNAME to the value bob?

  • A. set USERNAME bob
  • B. $USERNAME==bob
  • C. var USERNAME=bob
  • D. USERNAME<=bob
  • E. USERNAME=bob
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 10

What is the purpose of the PATH environment variable?

  • A. It allows the execution of commands without the need to know the location of the executable.
  • B. It increases security by preventing commands from running in certain locations.
  • C. It specifies the location of a user's home directory.
  • D. It indicates the location of the default shell to be used when a user logs in.
  • E. It contains the absolute path to the current directory.
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 11

Which command displays file names only and no additional information?

  • A. ls -a
  • B. ls -lh
  • C. ls -l
  • D. ls -alh
  • E. ls -nl
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

Which of the following commands output the content of the file Texts 2.txt? (Choose two.)

  • A. cat 'Texts 2.txt’
  • B. cat -- Texts 2.txt
  • C. cat |Texts 2.txt|
  • D. cat 'Texts\ 2.txt’
  • E. cat Texts\ 2.txt
Answer:

AB

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

Question 13

Which of the following commands shows the absolute path to the current working directory?

  • A. who
  • B. cd ..
  • C. pwd
  • D. ls -l
  • E. cd ~/home
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 14

Most commands on Linux can display information on their usage. How can this information typically
be displayed?

  • A. By running the command with the option /? or /??.
  • B. By running the command with the option ?! or ?=!.
  • C. By running the command with the option /doc or /documentation.
  • D. By running the command with the option -h or --help.
  • E. By running the command with the option -m or --manpage.
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 15

FILL IN THE BLANK
What parameter of ls prints a recursive listing of a directory's content? (Specify ONLY the option
name without any values or parameters.)

Answer:

ls -R

User Votes:
Discussions
vote your answer:
0 / 1000
To page 2