
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
2026 LPI LINUX Essentials Certification Test – 200 Correctly Answered Practice Questions/ Linux Essentials Certificate Exam Practice Test Latest 2026-2027 2026 LPI LINUX Essentials Certification Test – 200 Correctly Answered Practice Questions/ Linux Essentials Certificate Exam Practice Test Latest 2026-2027
Typology: Exams
1 / 40
This page cannot be seen from the preview
Don't miss anything!

































How is Linux installed in a virtualized environment? - ANSWER-Typically through conventional means, from installation media onto the abstracted bare metal. In a Linux system, there is a user named James and a group named SpecialGroup. Which command would add James to SpecialGroup? A. groupmod - c James SpecialGroup B. usermod - g SpecialGroup James C. changegroup James SpecialGroup D. groupchange James:SpecialGroup - ANSWER-B. usermod - g SpecialGroup James The Linux kernel, GNU core, X server, and GUI comprise a Linux ____________.
D. Inkscape E. MySQL - ANSWER-C. Samba In Bash scripting, what is redirected when 2>&1 is inserted at the end of a command? A. Standard error to a standard output. B. Standard input to a standard error. C. Standard output to a standard error. D. Standard error to a standard output. - ANSWER-D. Standard error to a standard output. What is the difference between the "i" and "a" commands of the VI editor? A. "i" requires the user to switch between VI modes, "a" switches modes automatically. B. "i" inserts text before the current cursor position, "a" inserts text after the cursor. C. "i" starts every new line at the first character, "a" keeps the indentation of the previous line. D. "i" temporarily suspends editing of a file to the background, "a" terminates editing. - ANSWER-B. "i" inserts text before the current cursor position, "a" inserts text after the cursor. Which is correct regarding the command foo ifconfig > bar.txt? A. The stdout from the command ifconfig is appended to the filebar.txt. B. The stdout from the command ifconfig overwrites the file bar.txt. C. The command ifconfig receives its stdin from the stdout of the command bar.txt. D. The stderr from the command ifconfig is saved to the file bar.txt. - ANSWER- B. The stdout from the command ifconfig overwrites the file bar.txt
B. echo "ABC" < myfile.txt C. echo "ABC" > myfile.txt D. echo "ABC" | myfile.txt - ANSWER-C. echo "ABC" > myfile.txt Which character starts a comment line in a shell script file? A. ; B. * C. # D. / - ANSWER-C. # Which of the following commands will replace each occurrence of 'amy' with 'Amy' in 'newfile'? A. sed '/amy/Amy' file > newfile B. sed s/amy/Amy/ file < newfile C. sed 's/amy/Amy' file > newfile D. sed 's/amy/Amy/g' file > newfile E. sed 's/amy, Amy/' file > newfile - ANSWER-D. sed 's/amy/Amy/g' file > newfile ("s" = substitution operation, "/" are delimiters, substitute flag /g (global replacement) specifies the sed command to replace all the occurrences of the string in the line.) Which of the following commands creates a compressed archive file called 'work.tar' from the contents of the ./work/ directory? A. tar --new work.tar ./work/ B. tar - cf work.tar ./work/ C. tar - create work.tgz - content ./work/
D. tar work.tar < ./work/ E. tar work > work.tar - ANSWER-B. tar - cf work.tar ./work/ Which of the following commands is used to update the list of available packages when using Debian based package management? A. apt update B. apt upgrade C. apt refresh D. apt install - ANSWER-A. apt update Which RPM command will output the name of the package that supplied the /etc/exports file? A. rpm - f /etc/exports B. rpm - qf /etc/exports C. rpm - qi /etc/exports D. rpm - qp /etc/exports - ANSWER-B. rpm - qf /etc/exports Find answer here: https://linuxize.com/post/rpm-command-in-linux/ What is detailed by a Free Software license? A. Details of the technical documentation. B. The programming languages that may be used to keep the license. C. A list of libraries required to compile the licensed software. D. Conditions for distributing and modifying the licensed software. - ANSWER-D. Conditions for distributing and modifying the licensed software. Which of the following commands lists the dependencies of a given dpkg package?
What is the purpose of using the command ls - r? A. To include the permissions of a listed directory. B. To include the details of file system internals. C. To include file permissions. D. To include the contents of sub-directories. - ANSWER-D. To include the contents of sub-directories. Which of the following commands can be used to remove the 'Documents' directory? (Choose two correct answers) A. undir Documents B. rmdir Documents C. rm - r Documents D. dir - r Documents - ANSWER-B. rmdir Documents C. rm - r Documents Which of the following commands add the directory /new/dir/ to $PATH? (Choose two correct answers) A. $PATH=/new/dir: $PATH B. PATH=/new/dir: $PATH C. Import PATH=/new/dir: $PATH D. export PATH=/new/dir: $PATH - ANSWER-B. PATH=/new/dir: $PATH C. Import PATH=/new/dir: $PATH When johnd, who is currently in the directory /home/johnd/Downloads/, runs the command ls ../Documents/, which directory's contents will be displayed?
A. /home/johnd/Documents/ B. /home/johnd/Downloads/Documents/ C. /Documents/ D. /home/Documents - ANSWER-A. /home/johnd/Documents/ A directory includes the files a.py, b.py, and c.txt. Which command will copy the two files ending in .py to the /tmp/ directory? A. cp !!.py /tmp/ B. cp *.py /tmp/ C. cp. .py /tmp/ D. cp #.py /tmp/ E. cp $?.py /tmp/ - ANSWER-B. cp *.py /tmp/ How can the file MyScript.py be searched for in the current directory and all sub- directories? A. find. - name MyScript.py B. grep MyScript.py | find C. grep - r MyScript.py D. less MyScript.py E. search MyScript.py - ANSWER-A. find. - name MyScript.py A user tries to move the file "Script.py" to another location using the command "mv script.py destination_folder", but an error occurs. What could be the reason for the error? A. The user must be a superuser to move the file. B. The file may be corrupted. C. Txt files cannot be moved.
Which of the following commands can be used to view the full path of the passwd command? (Choose two answers) A. type passwd B. which passwd C. where passwd D. what passwd - ANSWER-A. type passwd B. which passwd Which command can be used to check previous commands that were executed from the shell? A. history B. lastcommands C. previous D. There is no way to do that - ANSWER-A. history Which of the following commands is the fastest way to search for files in the file system? A. find B. search C. grep D. locate - ANSWER-D. locate How can files and directories be hidden in Linux? A. By adding a period before the file or directory name. B. By changing their attributes to hidden. C. A special tool can be used to do that.
D. By changing their permissions so that only some users can see them. - ANSWER-A. By adding a period before the file or directory name. A user wants to move a file named "MyFile" from /root/Desktop to the current working directory. Which of the following commands will perform that operation? A. mv /root/Desktop/MyFile ../ B. mv /root/Desktop/MyFile ./ C. mv /root/Desktop/MyFile ../. D. mv /root/Desktop/MyFile ./.. - ANSWER-B. mv /root/Desktop/MyFile ./ "./" indicates current working dir Which of the following symbols can be used together with the cd command to change the current working directory to the current user's home directory? A. & B. ~ C. / D. # - ANSWER-B. ~ Which command can be used to recursively view the listing of the current directory, its sub-directories, and its contents? A. ls - r B. recursive C. tree D. ls - subdir - ANSWER-A. ls - r A user wants to create multiple empty files. Which of the following commands will do that?
D. echo "123" >> foo.txt E. echo "123" > foo.txt - ANSWER-E. echo "123" > foo.txt Which of the following keys is pressed to exit the less tool? A. :wc B. x C. e D. q E.! - ANSWER-D. q Which command will display the last five lines of file.txt? A. head - n 5 file.txt B. tail file.txt C. last - n 5 file.txt D. tail - n 5 file.txt - ANSWER-D. tail - n 5 file.txt What would be the output of the following? for instance in a b c; do echo - n "$instance"; done A. a\nb\nc\n B. "a" "b" "c" C. instance instance instance D. a b c - ANSWER-B. "a" "b" "c"
When executed from a Bash shell, which of the following commands directly executes the instruction from the /usr/local/bin/script.sh file, without starting a sub- shell? A. source /usr/local/bin/script.sh B. run /usr/local/bin/script.sh C. /bin/bash/usr/local/bin/script.sh D. /usr/local/bin/script.sh - ANSWER-B. run /usr/local/bin/script.sh A Bash script includes the following line: echo $2 $1 What will be the output if the ./script.sh test1 test2 command is run? A. test1 test B. test2 test C. script.sh test D. script.sh test E. test1 script.sh - ANSWER-B. test2 test Which of the following commands will set the variable 'var' to 'hello world'? (Choose two answers) A. var=hello\ world B. var=$hello world C. $var='hello world' D. var="hello world" - ANSWER-A. var=hello\ world D. var="hello world" What is the correct command to extract the contents of the archive file download.bz2? A. unpack download.bz
D. 1> file - ANSWER-B. 2> file What does the 'wc' command do? A. It counts how many lines there are in a file. B. It counts how many words there are in a file. C. It counts how many characters there are in a file. D. All of the above. - ANSWER-D. All of the above. Which of the following commands merges the content of multiple files to a single file? A. merge file1 file2 file3 > newfile B. cat file1 file2 file3 > newfile C. echo file1 file2 file3 > newfile D. type file1 file2 file3 >> newfile - ANSWER-C. echo file1 file2 file3 > newfile You want to extract only the 4th field of the /etc/passwd file to a new file. Which command will do that? A. cut - f - 4 - d ' ' /etc/passwd > newfile B. cut - f 4 - d ':' /etc/passwd > newfile C. cut - f 1-4 /etc/passwd > newfile D. cut - f 4 /etc/passwd > newfile - ANSWER-B. cut - f 4 - d ':' /etc/passwd > newfile When creating a Bash script, which of the following must be placed in the first line, to make it executable? A. B. !#/bin/bash
C. #!/bin/bash D. - ANSWER-C. #!/bin/bash Which of the following is the correct way to display the numbers of lines in a file named "a.list"? A. cat - l a.list B. cat - lines a.list C. cat - numbers a.list D. cat - n a.list - ANSWER-D. cat - n a.list If you want to create a password-locked zip file, which of the following commands would you use? (Choose more than one answer) A. zip - encrypt "locked.zip" file1 file2 file B. zip --lock "locked.zip" file1 file2 file C. zip - e "locked.zip" file1 file2 file D. zip - password "locked.zip" file1 file2 file3 - ANSWER-A. zip - encrypt "locked.zip" file1 file2 file C. zip - e "locked.zip" file1 file2 file Which of the following will list the contents of a tar archive? A. Run the tar command with - t. B. Run the grep command. C. Run the find command. D. Run the zless command. E. Run the zlist command. - ANSWER-A. Run the tar command with - t.
B. User accounts, ordered by number of logins. C. Running processes, ordered by CPU or RAM consumption. D. User groups, ordered by number of members. E. User accounts, ordered by number of files. - ANSWER-C. Running processes, ordered by CPU or RAM consumption. Which of the following is true about the dmesg command? A. It traces the execution of a command and shows each step the program performs. B. It sends messages to the command lines of all current user sessions. C. It displays kernel-related messages on UNIX-like systems. D. It immediately outputs all new messages written to the system journal. - ANSWER-C. It displays kernel-related messages on UNIX-like systems. What is the maximum niceness value that a regular user can assign to a process using the nice command, when executing a new process? A. 9 B. 19 C. 49 D. 99 - ANSWER-B. 19 (nice is used to invoke a utility or shell script with a particular CPU priority, thus giving the process more or less CPU time than other processes. A niceness of - 20 is the highest priority and 19 is the lowest priority) Which of the following directories contains information, documentation, and sample configuration files for installed software packages? A. /usr/share/docs/ B. /etc/defaults/
C. /var/info/ D. /doc/ E. /usr/examples/ - ANSWER-A. /usr/share/docs/ Which of the following commands can be used to resolve a DNS name to an IP address? A. dnsname B. dns C. host D. query E. ipconfig - ANSWER-C. host Where is the operating system of a Raspberry Pi stored? A. Master device attached to the IDE bus. B. Read-only partition near the BIOS. C. Removable SD card in the Raspberry Pi. D. Linux extension module attached to the GPIO pins. - ANSWER-C. Removable SD card in the Raspberry Pi. Reverse DNS assigns host names to IP addresses. How is the name of the IP address 198.51.100.165 stored on a DNS server? A. In the PTR record for 165.100.51.198.in-addr.arpa B. In the A record for 165.100.51.198.ipv4.arpa C. In the ARPA record for 165.100.51.198.rev D. In the Rev record for arpa.in-addr.198.51.100. E. In the RNAME record for 198- 51 - 100 - 165.rev.apra - ANSWER-A. In the PTR record for 165.100.51.198.in-addr.arpa