LPI Linux Essentials Exam — Questions and Answers
Question 1: Which command changes the primary group of user 'bob' to 'marketing'?
- usermod -g marketing bob (Correct answer)
- usermod -G marketing bob
- chgrp marketing bob
- groupmod -u bob marketing
Correct answer: usermod -g marketing bob
usermod -g (lowercase) changes the primary group, while -G (uppercase) modifies supplementary groups.
Question 2: A user has an archive named `data.tar.bz2` and needs to extract only a single file named `config/settings.conf` from within it. Which command will accomplish this specific task?
- tar -xjf config/settings.conf data.tar.bz2
- tar -xjf data.tar.bz2 config/settings.conf (Correct answer)
- bunzip2 data.tar.bz2 && tar -xf data.tar config/settings.conf
- tar -tjf data.tar.bz2 | grep config/settings.conf
Correct answer: tar -xjf data.tar.bz2 config/settings.conf
To extract a specific file from a `tar` archive, you provide the path to that file as an argument after the archive name. The command `tar -xjf data.tar.bz2` correctly specifies the extraction (`-x`), indicates it's a bzip2 file (`-j`), and provides the archive filename (`-f data.tar.bz2`), followed by the specific member to extract. While the `bunzip2` and `tar` combination would work, it's an unnecessary two-step process. `grep` would only list the file, not extract it.
Question 3: Which command is used to change the ownership of `file.txt` to the user `anne` and the group `developers` in a single operation?
- chmod anne:developers file.txt
- chgrp developers file.txt && chown anne file.txt
- chown anne:developers file.txt (Correct answer)
- chown anne developers file.txt
Correct answer: chown anne:developers file.txt
The `chown` command is used to change file ownership. The syntax `chown user:group filename` allows changing both the user owner and the group owner simultaneously.
Question 4: What is the function of the northbridge chip in older PC architectures?
- Control USB and audio devices
- Control power distribution on the motherboard
- Handle BIOS firmware storage
- Manage high-speed connections between CPU, RAM, and GPU (Correct answer)
Correct answer: Manage high-speed connections between CPU, RAM, and GPU
The northbridge managed the high-bandwidth connections between the CPU, system RAM, and the graphics card in older chipset architectures.
Question 5: What is the parent process of all other processes on a Linux system, typically having PID 1?
- cron
- kernel
- init (or systemd) (Correct answer)
- bash
Correct answer: init (or systemd)
The init process (or systemd on modern systems) is the first process started by the kernel and is the ancestor of all other processes with PID 1.
Question 6: Which command decompresses a .xz file while keeping the original compressed file?
- xz -dk file.xz (Correct answer)
- xz -t file.xz
- xz -f file.xz
- xz -c file.xz
Correct answer: xz -dk file.xz
The -d decompresses and -k keeps the original, so both the compressed and decompressed files remain.
Question 7: A user runs the `umask 0027` command. What will the default permissions be for a newly created directory afterwards?
- drw-r-----
- drwxr-x--- (Correct answer)
- drwxrwxrwx
- drwxr-xrwx
Correct answer: drwxr-x---
The system starts with default permissions for a directory, which is 777 (`rwxrwxrwx`). The `umask` value is subtracted from this default. 777 - 027 results in 750. This octal value corresponds to `rwxr-x---`.
Question 8: What does `tail -f /var/log/syslog` do?
- Shows the first 10 lines and exits
- Filters lines matching 'syslog'
- Follows the file and prints new lines as they are written (Correct answer)
- Shows lines in reverse order
Correct answer: Follows the file and prints new lines as they are written
tail -f follows a file in real time, printing new content as it is appended.
Question 9: A user wants to search for the case-insensitive string "error" within the `system.log` file. Which of the following commands is the correct way to perform this search?
- cat system.log | filter -i "error"
- grep -i "error" system.log (Correct answer)
- search --ignore-case "error" system.log
- find "error" system.log
Correct answer: grep -i "error" system.log
The `grep` command is the standard tool for searching text using patterns. The `-i` option makes the search case-insensitive, so it will match "error", "Error", "ERROR", etc.
Question 10: Which virtual filesystem in Linux provides an interface to kernel data structures and information about system processes?
- /tmp
- /proc (Correct answer)
- /sys
- /dev
Correct answer: /proc
The `/proc` filesystem is a special, pseudo-filesystem that provides an interface to kernel data structures. It doesn't contain real files but runtime system information, such as system memory, devices mounted, and hardware configuration. It contains a directory for each running process, identified by its process ID (PID).
Question 11: Which command is used to display the contents of a directory in Linux?
- ls (Correct answer)
- pwd
- cd
- dir
Correct answer: ls
The `ls` command (list) is a fundamental utility in Linux used to display the contents of a directory. By default, it lists files and subdirectories within the current working directory. Various options can be used with `ls` to provide more detailed information, such as file permissions, ownership, and modification dates.
Question 12: Which field in /etc/passwd specifies the user's default shell?
- Field 7 (Correct answer)
- Field 5
- Field 4
- Field 6
Correct answer: Field 7
The seventh (last) field in /etc/passwd specifies the user's login shell, e.g., /bin/bash.
Question 13: When you use software licensed under the GNU GPLv2, what is a key obligation if you distribute a modified version of that software?
- You can re-license your modified version under any license you choose.
- You must make the source code of your modifications available under the GPLv2. (Correct answer)
- You must pay a licensing fee to the original author.
- You must get written permission before distributing the software.
Correct answer: You must make the source code of your modifications available under the GPLv2.
The GNU GPL is a 'copyleft' license, which means that if you create a derivative work (e.g., by modifying the source code) and distribute it, you must also license your derivative work under the GPL. A core part of this is making the corresponding source code available to the recipients.
Question 14: What is the purpose of the /etc/skel directory?
- It defines the default PATH for all users
- It stores skeleton scripts for system services
- It contains template files copied to a new user's home directory (Correct answer)
- It holds backup copies of /etc/passwd
Correct answer: It contains template files copied to a new user's home directory
Files in /etc/skel are automatically copied into the home directory of any newly created user.
Question 15: What is the purpose of `tar --exclude='*.log'` when creating an archive?
- Skip all files matching the pattern *.log (Correct answer)
- Only archive .log files
- Extract only non-.log files
- Delete .log files after archiving
Correct answer: Skip all files matching the pattern *.log
The --exclude option tells tar to skip any files matching the given pattern during archive creation.
Question 16: What is the purpose of the shebang line #!/bin/bash at the top of a script?
- It sets the script's permissions automatically
- It is a comment and has no effect
- It imports the bash library
- It specifies the interpreter that should execute the script (Correct answer)
Correct answer: It specifies the interpreter that should execute the script
The shebang tells the OS which interpreter to use when the script is executed directly.
Question 17: What does `unzip -l archive.zip` do?
- Deletes listed files from archive.zip
- Lists zip archives in the current directory
- Lists the contents of archive.zip without extracting (Correct answer)
- Extracts archive.zip to a list of directories
Correct answer: Lists the contents of archive.zip without extracting
The -l option displays the file listing inside the zip archive including sizes and dates, without extracting anything.
Question 18: Which command displays the process ID (PID) of a running program by its name?
- getpid
- pidof (Correct answer)
- pgrep -n
- findpid
Correct answer: pidof
The `pidof` command returns the PID(s) of a named running program, making it easy to script process management tasks.
Question 19: What does the chmod 755 filename command set as permissions?
- Owner: rw-, Group: r--, Others: r--
- Owner: rwx, Group: rw-, Others: r--
- Owner: rwx, Group: r-x, Others: r-x (Correct answer)
- Owner: rwx, Group: rwx, Others: rwx
Correct answer: Owner: rwx, Group: r-x, Others: r-x
7=rwx for owner, 5=r-x for group, 5=r-x for others.
Question 20: What is the key difference between an absolute path and a relative path?
- An absolute path is valid from anywhere in the filesystem, while a relative path depends on the current directory. (Correct answer)
- Relative paths can only be used to navigate to subdirectories.
- An absolute path is shorter than a relative path.
- A relative path always starts from the user's home directory.
Correct answer: An absolute path is valid from anywhere in the filesystem, while a relative path depends on the current directory.
An absolute path specifies a location from the root directory (`/`) and is unambiguous. A relative path specifies a location starting from the current directory, so its meaning changes depending on where you are.
Question 21: In a `case` statement, which pattern acts as a catch-all (default) match?
- default)
- *) (Correct answer)
- else)
- any)
Correct answer: *)
The `*)` pattern matches any string not matched by earlier patterns, serving as the default case.
Question 22: Which special variable contains the process ID of the currently running script?
- $$ (Correct answer)
- $#
- $!
- $0
Correct answer: $$
`$$` expands to the PID of the current shell or script, often used to create unique temporary filenames.
Question 23: What does the `tr 'a-z' 'A-Z'` command do?
- Deletes lowercase letters
- Reverses the alphabet
- Counts lowercase letters
- Translates lowercase letters to uppercase (Correct answer)
Correct answer: Translates lowercase letters to uppercase
tr translates characters; 'a-z' to 'A-Z' converts every lowercase letter to its uppercase equivalent.
Question 24: Which syntax correctly passes the output of `date` as an argument to `echo` using command substitution?
- echo $(date) (Correct answer)
- echo $[date]
- echo {date}
- echo %date%
Correct answer: echo $(date)
`$(command)` substitutes the command's output inline, so `echo $(date)` prints the current date.
Question 25: What does the sticky bit do when set on a directory?
- Runs files as the directory owner
- Makes the directory immutable
- Prevents new files from being created
- Prevents users from deleting files they do not own (Correct answer)
Correct answer: Prevents users from deleting files they do not own
The sticky bit on a directory restricts file deletion so only the file owner, directory owner, or root can remove files.
Question 26: Which command is used to display the first 10 lines of a text file named `report.txt`?
- head report.txt (Correct answer)
- cat report.txt | top -n 10
- less -n 10 report.txt
- tail report.txt
Correct answer: head report.txt
The `head` command, by default, displays the first 10 lines of a specified file. The `tail` command shows the last lines, `cat` displays the entire file, and `less` is a pager for viewing files page by page.
Question 27: A shell script contains the following lines: MY_VAR="Linux System" echo "I am learning about the '$MY_VAR'" echo "I am learning about the \"$MY_VAR\"" What is the output when this script is executed?
- I am learning about the 'Linux System' I am learning about the "Linux System"
- I am learning about the '$MY_VAR' I am learning about the "$MY_VAR"
- I am learning about the '$MY_VAR' I am learning about the "Linux System" (Correct answer)
- I am learning about the 'Linux System' I am learning about the "$MY_VAR"
Correct answer: I am learning about the '$MY_VAR' I am learning about the "Linux System"
Single quotes (') prevent any kind of expansion, so '$MY_VAR' is printed literally. Double quotes (") allow for variable expansion, so "$MY_VAR" is replaced with its value, "Linux System". The backslashes before the inner double quotes are necessary to escape them so they are printed as literal characters.
Question 28: What is a primary difference between the Apache 2.0 license and the MIT license?
- The MIT license requires you to publish all modifications.
- The MIT license is a copyleft license, while Apache 2.0 is not.
- The Apache 2.0 license prohibits commercial use.
- The Apache 2.0 license includes an express grant of patent rights, while the MIT license does not. (Correct answer)
Correct answer: The Apache 2.0 license includes an express grant of patent rights, while the MIT license does not.
A key feature of the Apache 2.0 license is that it includes an explicit grant of patent rights from contributors to users. The MIT license is much simpler and does not explicitly address patent rights, which is a key reason some projects and corporations prefer the Apache license.
Question 29: What does the `free` command display on a Linux system?
- Available CPU cores
- Free disk space
- Free inodes on filesystems
- Physical and swap memory usage (Correct answer)
Correct answer: Physical and swap memory usage
The `free` command shows the total, used, and available physical RAM and swap space on the system.
Question 30: A graphic designer creates an icon set and wants to allow others to use it for free, even in commercial projects. However, they want to ensure that any modified versions of the icons are also shared freely under the same terms. Which Creative Commons license should they use?
- CC BY (Attribution)
- CC BY-ND (Attribution-NoDerivs)
- CC BY-SA (Attribution-ShareAlike) (Correct answer)
- CC BY-NC (Attribution-NonCommercial)
Correct answer: CC BY-SA (Attribution-ShareAlike)
The Creative Commons Attribution-ShareAlike (CC BY-SA) license allows others to remix, adapt, and build upon the work even for commercial purposes, as long as they give credit and license their new creations under the identical terms. This 'ShareAlike' component is a form of copyleft for creative works.
Question 31: Which command displays the full path of the current working directory?
- dir
- pwd (Correct answer)
- path
- cwd
Correct answer: pwd
The `pwd` (print working directory) command outputs the absolute path of the current directory.
Question 32: Which of the following license types is characterized by the 'copyleft' provision, requiring that derivative works also be distributed under the same or an equivalent license?
- Proprietary licenses
- GNU General Public License (GPL) (Correct answer)
- Public Domain
- Permissive licenses like MIT or Apache
Correct answer: GNU General Public License (GPL)
The GNU General Public License (GPL) is the most well-known copyleft license. A key feature of copyleft is that it requires any software that is modified or extended from the original work to be released under the same license, ensuring the software remains free.
Question 33: A user is currently in the `/home/user/documents` directory. Which of the following commands will change the current directory to the `/home/user` directory?
- cd .. (Correct answer)
- cd /
- cd ~/
- cd documents
Correct answer: cd ..
The `..` represents the parent directory. From `/home/user/documents`, the parent directory is `/home/user`. Therefore, `cd ..` will navigate one level up to the desired directory.
Question 34: Which command displays a dynamic, real-time view of running processes on a Linux system?
- jobs
- ps
- pstree
- top (Correct answer)
Correct answer: top
The `top` command provides an interactive, continuously updated display of system processes and resource usage.
Question 35: A file has the permissions `-rw-r--r--`. The owner wants to add write permission for the group members without affecting any other permissions. Which of the following commands will achieve this?
- chmod g=w file.txt
- chmod o+w file.txt
- chmod g+w file.txt (Correct answer)
- chmod 664 file.txt
Correct answer: chmod g+w file.txt
The symbolic notation `g+w` specifically targets the 'group' (`g`) and 'adds' (`+`) the 'write' (`w`) permission. Using octal `664` would work in this specific case, but it resets all permissions rather than just adding one. The `g+w` syntax is the most precise way to add a permission without altering others.
Question 36: What is the effect of setting a user's shell to /sbin/nologin?
- The user's account is deleted at next login
- The user can only log in via SSH
- The user is restricted to a chroot environment
- The user cannot log in interactively (Correct answer)
Correct answer: The user cannot log in interactively
/sbin/nologin prints a message and rejects interactive login attempts, commonly used for service accounts.
Question 37: What class of IPv4 address range is reserved for private networks and not routable on the public internet (e.g., 192.168.x.x)?
- Loopback
- Public
- Multicast
- Private (RFC 1918) (Correct answer)
Correct answer: Private (RFC 1918)
RFC 1918 defines private IP ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) that are reserved for internal networks and not routed on the public internet.
Question 38: What is the purpose of the lsmod command?
- List available but unloaded kernel modules
- Load a specific kernel module
- Show module dependency tree
- Display currently loaded kernel modules (Correct answer)
Correct answer: Display currently loaded kernel modules
lsmod shows the status of all currently loaded kernel modules, including their size and usage count.
Question 39: In Linux, what type of file is /dev/sda?
- A configuration file for the SCSI driver
- A regular text file containing disk information
- A symbolic link to the disk partition table
- A block device file representing a storage device (Correct answer)
Correct answer: A block device file representing a storage device
/dev/sda is a block device file that represents the first SCSI/SATA disk; the kernel uses it to communicate with the storage device.
Question 40: What is the absolute path of the root directory in Linux?
- //
- / (Correct answer)
- /home
- /root
Correct answer: /
The root directory is represented by a single forward slash `/`, which is the top of the filesystem hierarchy.
LPI Linux Essentials Exam
The LPI Linux Essentials Exam (010-160) validates foundational Linux knowledge including open-source concepts, command-line navigation, data extraction, archiving, user management, file permissions, basic scripting, hardware awareness, process monitoring, and networking basics.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds
These practice questions were written with AI tools. They are not real exam questions. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- lpi.org — Eligibility, score validity, test delivery, exam format, passing score, score release, time limit · verified Oct 2026