Practice for the LPI Linux Essentials exam with 13 exam-style practice questions, instant answer reveals, and concise explanations of every correct answer. Topics include: How is it possible to determine if an executable file is a shell script read by Bash?. Follow @CertPunch and visit certpunch.com for more certification practice exams and study content.
Prefer hands-on? Take this round as an interactive practice test — answer every question, get instant feedback, and see your score: Start the LPI Linux Essentials practice test →
What you will practice
- How is it possible to determine if an executable file is a shell script read by Bash?
- Which of the following programs on a Linux system could you use as a replacement for Adobe Photoshop?
- Which is NOT a Linux distribution?
- Which of the following programs on a Linux system could you use as a replacement for Microsoft PowerPoint?
- Which Linux distribution is used as a basis for the creation of Ubuntu Linux?
- You are working on a script that requires combining the contents of two text files, file1.txt and file2.txt i…
Answers and explanations
Tap a question to expand the answer and the exam reasoning. Try to commit to your own pick first.
Q1. How is it possible to determine if an executable file is a shell script read by Bash?
Answer: B. The first line starts with #!/bin/bash.
A bash script is identified by its shebang line, which starts with hash exclamation slash bin slash bash. Linux ignores file extensions, so the dot s h suffix is just a human convention and not required by the system.
Q2. Which of the following programs on a Linux system could you use as a replacement for Adobe Photoshop?
Answer: B. Gimp
GIMP is the correct answer because it is a widely used open source graphics editor that competes with Adobe Photoshop. For the exam, remember that common Linux desktop applications often mirror proprietary software, such as using LibreOffice for word processing.
Q3. Which is NOT a Linux distribution?
Answer: D. Torvalds
Torvalds is correct because it refers to Linus Torvalds, the creator of the Linux kernel, rather than an actual operating system distribution. Knowing the major distributions, such as Debian, openSUSE, and CentOS, is essential for exam success.
Q4. Which of the following programs on a Linux system could you use as a replacement for Microsoft PowerPoint?
Answer: D. Impress
LibreOffice Impress is the correct answer because it is the standard open source presentation software used as a replacement for Microsoft PowerPoint. For the exam, familiarize yourself with the LibreOffice suite equivalents for common proprietary applications.
Q5. Which Linux distribution is used as a basis for the creation of Ubuntu Linux?
Answer: D. Debian
Debian is the correct answer because Ubuntu is a popular Linux distribution built directly upon the Debian architecture. Understanding these family relationships between distributions, such as Ubuntu deriving from Debian, is crucial for the exam.
Q6. You are working on a script that requires combining the contents of two text files, file1.txt and file2.txt into a single output on the terminal. Which command should you use?
Answer: C. cat
The cat command, derived from concatenate, reads multiple files and outputs their combined contents sequentially to the terminal. Commands like less or head are used for viewing files interactively or partially, not for combining multiple files.
Q7. What symbol can be used to represent none, one, or multiple characters within search criteria?
Answer: A. *
The asterisk is used in shell globbing to match zero, one, or many characters. On the exam, remember that the question mark matches exactly one character, while the asterisk matches any number of characters.
Q8. Which command would a user type to create a new file within the current directory?
Answer: D. touch
The touch command is the standard utility used to create a new empty file in Linux. If the specified file already exists, touch simply updates its modification and access times rather than overwriting it.
Q9. Which command is used to copy files from one directory to another?
Answer: C. cp
The cp command stands for copy and is used to duplicate files from one location to another. Remember that mv moves or renames files, while rm deletes them, and copy is not a valid command.
Q10. Which of the following is true about a recursive directory listing?
Answer: B. It includes the content of sub-directories
A recursive directory listing displays the contents of the target directory as well as all of its subdirectories. On the exam, associate the capital R flag with ls for recursive operations.
Q11. You have been asked to create a script that will present the user with an onboard menu in which they can select 4 different commands to run by entering 1, 2, 3, or 4. Which of the following statements should you use to create the simplest…
Answer: B. case
A case statement is the most efficient choice for matching a specific variable against a list of specific values like menu selections. While nested if statements can technically work, they become clumsy and hard to read.
Q12. Which of the following options is used to gzip a file called filename?
Answer: B. gzip filename
Running gzip followed by a filename compresses the file and appends a dot g z extension by default. The hyphen c flag is used to write to standard output, and hyphen z is used for tar, not gzip.
Q13. Which command line tool is used to compress a single file using the Burrows-Wheeler algorithm?
Answer: D. bzip2
The bzip2 command specifically compresses single files using the Burrows-Wheeler block sorting algorithm and Huffman coding. To easily remember this on the exam, gzip and xz use different algorithms, while tar is strictly an archiving tool that often pairs with them.
More LPI Linux Essentials drills and other practice exams are on @CertPunch. New rounds drop every few days at certpunch.com.