View Full LPI 101-500 Exam Dumps and Practice Test Dumps
Question: 41. Which command is commonly used to display the kernel release and system information?
- sysinfo
2. uname
3. kernelinfo
4. release
Correct Answer: 2. uname
Explanation:
The uname command displays information about the running system and Linux kernel. Using uname -r displays the kernel release version, while uname -a provides a broader set of information such as the kernel name, hostname, release, version, and machine architecture. This command is useful when identifying the kernel currently running or troubleshooting compatibility issues. The other choices are not standard general-purpose Linux commands for retrieving kernel information. Because LPI objectives include understanding basic system information commands, knowing how to use uname and its common options is important for Linux administration and system identification.
Question: 42. Which command can be used to locate an executable by searching directories listed in the PATH?
- find
2. locate
3. where
4. which
Correct Answer: 4. which
Explanation:
The which command searches the directories contained in the PATH environment variable and reports the executable that would normally be selected for a specified command. For example, which python may display the path to the Python executable that the shell will find through PATH. This is particularly useful when multiple versions of a program are installed. The find command searches filesystem hierarchies directly, while locate generally searches a filename database. where is not the standard Linux command for this purpose. Therefore, which is the appropriate utility for determining which executable is found through the current command search path.
Question: 43. Which command can search for files and directories based on specified criteria?
- find
2. search
3. scan
4. locatefile
Correct Answer: 1. find
Explanation:
The find command searches directory hierarchies and can select filesystem objects according to many different criteria. It can search by filename, file type, size, permissions, ownership, modification time, and other attributes. For example, find /home -name “*.txt” searches beneath /home for matching text filenames. Unlike which, which focuses on executable commands in the PATH, find can examine a specified filesystem hierarchy directly. It is also powerful because its results can be combined with additional actions and commands. The other choices are not standard Linux replacements for the find utility.
Question: 44. Which command can search a prebuilt database of filenames to locate files quickly?
- which
2. whereis
3. locate
4. find
Correct Answer: 3. locate
Explanation:
The locate command searches a database containing filesystem path information rather than walking through the filesystem each time. This can make filename searches very fast. However, the database must be updated periodically, so a recently created file might not immediately appear in the results. The find command performs a direct search through specified directories and can apply more detailed conditions. which focuses on executables found through the PATH, while whereis searches for binary, source, and manual locations associated with commands. Therefore, locate is the correct choice when referring specifically to a prebuilt filename database.
Question: 45. Which command can display the contents of a gzip-compressed file without replacing the original compressed file?
- gzipshow
2. unzip -p
3. cat.gz
4. gunzip -c
Correct Answer: 4. gunzip -c
Explanation:
The gunzip -c command decompresses gzip-compressed data and sends the resulting content to standard output. This allows a user to inspect compressed text without first manually extracting it into a separate file. For example, gunzip -c logfile.gz can display the decompressed contents in the terminal, and the output can also be passed to another command through a pipeline. The unzip utility is designed for ZIP archives, while gzipshow and cat.gz are not standard Linux commands. The -c option is important because it directs decompressed data to standard output instead of replacing the original compressed file.
Question: 46. Which archive utility is commonly used to create and extract tar archives?
- zip
2. tar
3. pack
4. archive
Correct Answer: 2. tar
Explanation:
The tar utility is widely used in Linux to create, inspect, and extract tar archives. A tar archive combines multiple files and directories into one archive while preserving filesystem information such as names and permissions. For example, tar -cf archive.tar files/ can create an archive, while tar -xf archive.tar can extract one. Tar archives can also be combined with compression formats such as gzip or xz. Although zip is another common archive format, it uses different tools and conventions. The commands pack and archive are not standard general-purpose replacements for tar.
Question: 47. Which command is commonly used to extract files from a ZIP archive?
- extract
2. gzip
3. tar
4. unzip
Correct Answer: 4. unzip
Explanation:
The unzip utility is commonly used to extract files and directories from ZIP archives on Linux systems where the utility is installed. Running unzip archive.zip normally extracts the contents into the current directory. Additional options can be used to list archive contents, select particular files, or specify a destination directory. The tar command handles tar archives, while gzip handles gzip compression rather than the ZIP archive format itself. extract is not the standard Linux command for ZIP files. Understanding the distinction between ZIP, tar, and compression utilities is useful when working with software packages, backups, and downloaded files.
Question: 48. Which command is used to control the default permissions applied when new files and directories are created?
- chmod
2. umask
3. mask
4. permset
Correct Answer: 2. umask
Explanation:
The umask command controls the permission bits that are masked when new files and directories are created. It therefore influences their default permissions rather than changing permissions on existing objects. For example, running umask displays the current mask, while assigning a value can change the shell’s default creation behavior. The chmod command is used to modify permissions on existing files and directories. mask and permset are not standard Linux commands for controlling the shell’s file-creation permission mask. Understanding umask is important because it helps explain why newly created files and directories receive particular default permission settings.
Question: 49. Which permission set allows the owner to read and write a file but not execute it?
- rw-
2. r-x
3. -wx
4. rwx
Correct Answer: 1. rw-
Explanation:
The symbolic permission string rw- means that the corresponding permission class has read and write permissions but does not have execute permission. In Linux permissions, r represents read, w represents write, and x represents execute. A hyphen indicates that the corresponding permission is absent. Therefore, rw- allows a user to view and modify a regular file but does not grant permission to execute it as a program. By comparison, rwx grants all three permissions, r-x grants read and execute, and -wx grants write and execute without read permission.
Question: 50. Which numeric permission value represents read and write permissions for one permission class?
- 5
2. 7
3. 3
4. 6
Correct Answer: 4. 6
Explanation:
Linux numeric permissions assign the value 4 to read, 2 to write, and 1 to execute. These values are added together for each permission class. Therefore, read plus write is 4 + 2, producing the numeric value 6. This corresponds to the symbolic permission rw-. The value 7 represents read, write, and execute; 5 represents read and execute; and 3 represents write and execute. Numeric permissions are commonly used with chmod, such as chmod 640 file, where the three digits represent owner, group, and other permissions. Understanding these values is fundamental to Linux permission management.
Question: 51. Which command can display the groups to which the current user belongs?
- showgroups
2. groups
3. groupinfo
4. members
Correct Answer: 2. groups
Explanation:
The groups command displays the group memberships associated with a user. When executed without an argument, it normally shows the groups associated with the current user. A username can also be supplied to examine the groups associated with another account. Group membership is important because Linux filesystem permissions can grant access based on a file’s group ownership. The id command can also provide group information together with UID and GID details, but groups provides a concise group-focused result. The alternatives are not standard Linux commands for displaying user group membership.
Question: 52. Which command is commonly used to create a new user account?
- addaccount
2. mkuser
3. newuser
4. useradd
Correct Answer: 4. useradd
Explanation:
The useradd command is a standard Linux utility for creating user accounts. It supports options for specifying account attributes such as the home directory, login shell, supplementary groups, and other settings. For example, useradd -m alice can create an account and request creation of a home directory, depending on the Linux distribution and its configuration. Some distributions also provide the higher-level adduser command. The alternatives addaccount, mkuser, and newuser are not the standard command represented by this question. Creating system accounts generally requires administrative privileges.
Question: 53. Which command is commonly used to change a user’s password?
- passwd
2. password
3. chpass
4. setpasswd
Correct Answer: 1. passwd
Explanation:
The passwd command is used to change or manage a user’s password. When an ordinary user runs it, the command typically requests the current password before asking for the new password, subject to the system’s authentication policies. An administrator with sufficient privileges can also use it to set passwords for other accounts. Modern Linux systems normally store protected password hashes in /etc/shadow rather than directly in /etc/passwd. The commands setpasswd, password, and chpass are not the standard general-purpose Linux command for changing a user’s password. Therefore, passwd is the correct answer.
Question: 54. Which file traditionally contains basic information about local user accounts, including usernames and UIDs?
- /etc/group
2. /etc/passwd
3. /etc/shadow
4. /etc/users
Correct Answer: 2. /etc/passwd
Explanation:
The /etc/passwd file traditionally contains basic account information such as usernames, user IDs, primary group IDs, home directories, and login shells. Despite its name, modern Linux systems generally do not store the actual password hashes in this file. Those protected authentication details are normally maintained in /etc/shadow. Group account information is commonly associated with /etc/group. The /etc/passwd file remains an important part of the traditional local-account configuration and is consulted through the system’s account-management mechanisms. Therefore, /etc/passwd is the correct file for basic local user-account information.
Question: 55. Which file normally stores protected password hashes for local Linux accounts?
- /etc/passwd
2. /var/users
3. /etc/passwords
4. /etc/shadow
Correct Answer: 4. /etc/shadow
Explanation:
The /etc/shadow file normally contains protected password hashes and password-aging information for local Linux accounts. Because this information is security-sensitive, access to the file is restricted compared with the more broadly readable /etc/passwd file. Modern Linux systems use the separation between these files so that general account information can be available without exposing protected authentication data. Utilities such as passwd manage password information without requiring users to edit /etc/shadow directly. The paths /var/users and /etc/passwords are not the standard locations for local password hashes, while /etc/passwd normally contains account information rather than the actual hashes.
Question: 56. Which directory contains device files in a typical modern Linux system?
- /sysdev
2. /devices
3. /dev
4. /hardware
Correct Answer: 3. /dev
Explanation:
The /dev directory contains device files that provide interfaces to hardware devices and various virtual or pseudo-devices. Examples include device nodes associated with disks, terminals, and other system resources. Modern Linux systems commonly populate /dev dynamically using mechanisms such as udev, which creates and manages device nodes according to kernel events and system rules. The /sys hierarchy serves a different purpose by exposing structured information about devices and kernel objects. The directories /devices, /hardware, and /sysdev are not the standard locations for Linux device files. Therefore, /dev is the correct answer.
Question: 57. Which directory contains a virtual filesystem that provides information about processes and kernel state?
- /processes
2. /proc
3. /kernel
4. /status
Correct Answer: 2. /proc
Explanation:
The /proc directory is a virtual filesystem provided by the Linux kernel. It exposes information about running processes and numerous aspects of the current kernel and system state. Running processes commonly have numeric directories under /proc, such as /proc/1234, where the number represents the process ID. Files such as /proc/cpuinfo and /proc/meminfo provide additional system information. Much of this content is generated dynamically rather than stored as ordinary files on disk. The directories /status, /processes, and /kernel are not the standard locations for this virtual filesystem.
Question: 58. Which directory provides a virtual interface for kernel and hardware information and is commonly associated with devices?
- /sys
2. /kernelinfo
3. /hardware
4. /system
Correct Answer: 1. /sys
Explanation:
The /sys directory is associated with the sysfs virtual filesystem. It exposes structured information about devices, drivers, kernel objects, and other components of the Linux kernel’s device model. It is particularly useful for examining hardware and driver relationships from user space. /dev should be distinguished from /sys: /dev contains device nodes used to access devices, whereas /sys provides information and interfaces associated with kernel objects and devices. /proc also exposes kernel information but has a stronger focus on processes and system state. Therefore, /sys is the correct directory for this description.
Question: 59. Which command provides a continuously updating interactive display of running processes and system resource usage?
- ps
2. tasks
3. top
4. procview
Correct Answer: 3. top
Explanation:
The top command provides an interactive display that continuously updates information about running processes and system resource usage. It commonly shows process IDs, users, CPU utilization, memory consumption, process states, and other information. Unlike ps, which generally provides a snapshot at the time it is executed, top refreshes its display so that administrators can observe changing system activity. It also provides interactive controls for sorting and, where supported, managing processes. The commands tasks and procview are not standard replacements for top. Therefore, top is the appropriate command for continuous interactive process monitoring.
Question: 60. Which signal is conventionally used to request that a process terminate gracefully?
- SIGSTOP
2. SIGKILL
3. SIGPAUSE
4. SIGTERM
Correct Answer: 4. SIGTERM
Explanation:
SIGTERM is conventionally used to request that a process terminate gracefully. Unlike SIGKILL, a process can catch and handle SIGTERM, allowing it to perform cleanup operations such as closing files, releasing resources, and saving state before exiting. This makes SIGTERM preferable when a normal shutdown is possible. SIGKILL forces termination and cannot be caught or handled by the target process, while SIGSTOP suspends a process rather than requesting its termination. SIGPAUSE is not a standard Linux signal name. Understanding common process signals is important for safe and effective Linux process management.