View Full LPI 101-500 Exam Dumps and Practice Test Dumps
Question: 101. Which command displays the amount of free and used disk space on mounted filesystems?
- du
2. lsblk
3. df
4. disk
Correct Answer: 3. df
Explanation:
The df command reports the amount of available and used disk space on mounted filesystems. It is useful when an administrator wants to determine whether a filesystem is approaching its capacity limit. The -h option can be used to display the values in human-readable units such as GiB or MiB. This differs from du, which estimates the amount of space consumed by files and directories rather than reporting filesystem capacity. lsblk focuses on block devices and their relationships. Understanding the distinction between df and du is important when investigating storage-related problems on Linux systems.
Question: 102. Which command reports the amount of disk space used by files and directories?
- du
2. df
3. space
4. usage
Correct Answer: 1. du
Explanation:
The du command estimates the amount of disk space used by files and directories. When executed without additional arguments, its output is generally based on the current directory and its contents. Options such as -h make the output easier to read, while -s can provide a summary for a specified directory. This differs from df, which reports filesystem-level free and used space. If an administrator wants to discover which directories are consuming large amounts of storage, du is often a useful starting point. Its results can vary depending on filesystem characteristics and options used.
Question: 103. Which directory is commonly used for temporary files that may be removed between system boots?
- /tmp
2. /boot
3. /srv
4. /opt
Correct Answer: 1. /tmp
Explanation:
The /tmp directory is traditionally used for temporary files created by applications and users. Files placed there are generally considered temporary and may be removed automatically depending on the Linux distribution and its system configuration. Because temporary data may disappear, users should not treat /tmp as a reliable location for permanent storage. /boot contains boot-related files, /srv is associated with data served by system services, and /opt is commonly used for optional application software. Understanding the purpose of standard directories helps administrators select appropriate locations for different types of data.
Question: 104. Which directory is commonly associated with optional third-party application software?
- /var
2. /opt
3. /tmp
4. /dev
Correct Answer: 2. /opt
Explanation:
The /opt directory is traditionally intended for optional or add-on application software. Software installed under /opt may be maintained separately from the operating system’s standard package locations. This directory is particularly useful for applications that are distributed independently or installed as self-contained software trees. /var is generally associated with variable data such as logs and caches, /tmp is intended for temporary files, and /dev provides interfaces to devices. Although modern distributions may organize software in different ways, /opt remains a recognized location in the Linux filesystem hierarchy.
Question: 105. Which directory is intended for data that is served by system services?
- /srv
2. /home
3. /proc
4. /run
Correct Answer: 1. /srv
Explanation:
The /srv directory is traditionally designated for data served by system services. For example, a server application may store service-related data beneath an appropriate directory under /srv. The filesystem hierarchy standard distinguishes this location from /home, which contains users’ home directories, and /proc, which provides a virtual filesystem containing process and kernel information. /run contains runtime data created after boot, such as information associated with currently running services and processes. The exact organization of service data varies between applications and distributions, but /srv has a defined conventional purpose.
Question: 106. Which command unmounts a filesystem from the Linux directory hierarchy?
- detach
2. unmount
3. umount
4. removefs
Correct Answer: 3. umount
Explanation:
The umount command removes a mounted filesystem from the directory hierarchy. Before a filesystem can normally be unmounted, it should not be actively in use by processes or have a working directory located within the mounted filesystem. For example, an administrator might use umount /mnt/data after finishing work with a mounted device. The command name is abbreviated as umount, rather than unmount. If an unmount operation fails because the filesystem is busy, the administrator may need to identify the processes or shells currently accessing it before trying again.
Question: 107. Which command displays the kernel ring buffer messages?
- kernel-log
2. dmesg
3. kmsgshow
4. syslog
Correct Answer: 2. dmesg
Explanation:
The dmesg command displays messages from the Linux kernel’s ring buffer. These messages can provide useful information about hardware detection, device drivers, boot activity, and other kernel-level events. Administrators often use dmesg when troubleshooting newly connected hardware or investigating kernel-related issues. On many modern systems, kernel messages are also collected by logging services such as systemd-journald, but dmesg remains an important command-line tool for examining kernel messages directly. The commands kernel-log and kmsgshow are not standard commands, while syslog refers more broadly to system logging mechanisms.
Question: 108. Which command displays how long the system has been running and provides load-average information?
- uptime
2. runtime
3. loadtime
4. systemtime
Correct Answer: 1. uptime
Explanation:
The uptime command displays the current time, how long the system has been running, the number of currently logged-in users, and system load averages. The load averages represent the average number of tasks in runnable or uninterruptible states over specified time periods. These values provide a quick indication of system workload, although they should be interpreted together with CPU, memory, and process information. The command does not simply report the current clock time. Commands such as runtime, loadtime, and systemtime are not standard Linux commands for obtaining this combined system-status information.
Question: 109. Which command provides information about available and used swap and physical memory?
- ramstat
2. memory
3. free
4. swapshow
Correct Answer: 3. free
Explanation:
The free command displays information about physical memory and swap usage. Its output commonly includes total, used, free, shared, buffer/cache, and available memory values, along with corresponding swap information. The -h option can make the values easier to read. This makes free useful for a quick overview of memory conditions. It should not be interpreted as a complete performance diagnosis because memory usage needs to be considered alongside workload, cache behavior, and other system metrics. Commands such as ramstat and swapshow are not standard replacements for free.
Question: 110. Which compression utility is commonly used to compress files using the bzip2 algorithm?
- gzip
2. bzip2
3. compress2
4. zip2
Correct Answer: 2. bzip2
Explanation:
The bzip2 command compresses files using the bzip2 compression algorithm. A file such as example.txt can be compressed with bzip2 example.txt, producing a compressed file with a .bz2 suffix. The corresponding bunzip2 command can decompress bzip2-compressed files. This is different from gzip, which uses the gzip compression format and commonly produces .gz files. The zip format is another compression and archiving format with different characteristics. Understanding common compression utilities is important for Linux administration because compressed files are frequently encountered in backups, software distributions, and log archives.
Question: 111. Which command is commonly used to compress files using the xz compression format?
- xz
2. xzpack
3. compress-x
4. lz
Correct Answer: 1. xz
Explanation:
The xz command is used to compress files using the xz compression format. It commonly produces files with a .xz extension and is frequently encountered in Linux software packages, source archives, and distribution files. The command can also decompress xz-compressed data, depending on the options and invocation used. xz is a compression utility rather than a general-purpose archive format like tar; it normally operates on individual files unless combined with another tool. Understanding the distinction between archiving and compression helps explain why commands such as tar and xz are often used together.
Question: 112. What is the primary purpose of the tar command when used without a compression option?
- To encrypt files
2. To create an archive containing multiple files
3. To change file permissions
4. To format a filesystem
Correct Answer: 2. To create an archive containing multiple files
Explanation:
The tar command is primarily used to create and manipulate archives. An archive can contain multiple files and directories while preserving information such as paths and, depending on options, metadata. By itself, tar is an archiving tool rather than a compression algorithm. Compression can be combined with tar through options that invoke formats such as gzip, bzip2, or xz. For example, a .tar.gz file represents a tar archive that has additionally been compressed with gzip. Understanding this distinction is important when working with Linux backups, software source packages, and distribution archives.
Question: 113. Which permission special bit causes files created inside a directory to inherit the directory’s group ownership in the traditional SGID directory behavior?
- SUID
2. Sticky bit
3. SGID
4. Read bit
Correct Answer: 3. SGID
Explanation:
The SGID, or set-group-ID, special permission bit has a useful directory-specific behavior on Linux. When SGID is set on a directory, newly created files and subdirectories generally inherit the directory’s group ownership rather than simply using the creating user’s default group. This is particularly useful for shared project directories where multiple users need to collaborate under a common group. SGID has a different meaning when applied to executable files. The SUID bit affects executable behavior, while the sticky bit on a directory restricts deletion of entries according to ownership and permission rules.
Question: 114. What is the primary effect of the sticky bit on a shared directory such as /tmp?
- It makes every file executable
2. It forces all files to have the same group
3. It prevents ordinary users from deleting files they do not own
4. It encrypts directory contents
Correct Answer: 3. It prevents ordinary users from deleting files they do not own
Explanation:
The sticky bit on a directory restricts deletion and renaming of entries by ordinary users. In a shared directory such as /tmp, users may create files that are visible to others, but one user should not normally be able to remove or rename another user’s files merely because the directory is writable. The sticky bit provides this additional protection. It does not encrypt files, force all files to share the same group, or make files executable. Administrators can identify the sticky bit in directory permissions, where it may appear as a t in the appropriate execute-permission position.
Question: 115. Which permission special bit allows an executable to run with the effective user ID of the file owner?
- SUID
2. SGID
3. Sticky bit
4. ACL
Correct Answer: 1. SUID
Explanation:
The SUID, or set-user-ID, permission bit causes an executable program to run with the effective user ID of the file owner rather than simply the ID of the user who launched it. This mechanism allows certain programs to perform operations that require additional privileges while still being invoked by ordinary users. Because SUID programs can have security implications, they should be carefully controlled and audited. SGID is a different special permission that can affect group identity, while the sticky bit provides directory deletion restrictions. ACLs provide additional access-control rules beyond traditional Unix permission bits.
Question: 116. Which command can change the owner and group associated with a file?
- chmod
2. chown
3. chperm
4. owner
Correct Answer: 2. chown
Explanation:
The chown command changes the ownership of files and directories. It can be used to change the user owner and, with appropriate syntax, the group associated with an object. For example, an administrator can use a command such as chown user:group file to specify both. The chmod command instead changes permission bits, controlling read, write, and execute access. Ownership changes are generally subject to permission restrictions, and changing ownership to another user commonly requires administrative privileges. Understanding ownership separately from permissions is fundamental to managing access to Linux files and directories.
Question: 117. Which command changes the permissions associated with a file or directory?
- chmod
2. chperm
3. access
4. permset
Correct Answer: 1. chmod
Explanation:
The chmod command changes the permission bits of files and directories. It supports symbolic notation, such as u+x, as well as numeric notation, such as 755. These permissions determine whether the owner, group, and other users can read, write, or execute the object. chmod does not change the file’s owner or group; that task is handled by commands such as chown and chgrp. Correct permission management is an important part of Linux security because overly broad permissions can expose data or allow unintended modifications, while overly restrictive permissions can prevent legitimate users and applications from functioning.
Question: 118. Which command displays the current system’s kernel and architecture information?
- systeminfo
2. uname
3. kernelinfo
4. archinfo
Correct Answer: 2. uname
Explanation:
The uname command displays system information such as the kernel name, depending on the options supplied. For example, uname -a requests a broad set of available system information, which can include the kernel release and machine architecture. This is useful when identifying the operating system environment or checking which kernel is currently running. The command does not provide every possible hardware detail, but it provides important kernel and system identification information. Commands such as systeminfo, kernelinfo, and archinfo are not standard Linux replacements for uname.
Question: 119. Which command can display the full path of an executable found through the shell’s PATH search?
- whereis
2. locate
3. which
4. pathfind
Correct Answer: 3. which
Explanation:
The which command can display the path of an executable that would be found through the directories listed in the PATH environment variable. For example, which python may return the location of the Python executable selected by the current PATH. It is useful when multiple versions of a program may exist on a system. The locate command searches a file-name database, while whereis can search for binaries, source files, and manual pages using its own rules. The shell’s type command can provide broader information about command resolution, including aliases and builtins.
Question: 120. Which command changes the priority value of a process when starting a new command?
- renice
2. priority
3. nice
4. setprio
Correct Answer: 3. nice
Explanation:
The nice command starts a new command with an adjusted scheduling nice value. A nice value influences the scheduling priority of a process relative to other processes. For example, an administrator can use nice when starting a CPU-intensive task to adjust how aggressively it competes for CPU time. This differs from renice, which is used to modify the nice value of a process that is already running. The exact range and permission requirements depend on the Linux implementation. Understanding nice and renice helps administrators manage CPU scheduling behavior for competing workloads.