View Full LPI 101-500 Exam Dumps and Practice Test Dumps
Question: 241. Which file commonly contains a message displayed to users before the login prompt?
- /etc/issue
2. /etc/fstab
3. /etc/hosts
4. /etc/shells
Correct Answer: 1. /etc/issue
Explanation:
The /etc/issue file commonly contains text that is displayed before a local login prompt. Administrators can use it to provide system identification, warnings, or general login notices. Its exact presentation depends on the login program and system configuration. It should not be confused with /etc/motd, which traditionally displays a message after successful login. /etc/fstab contains filesystem mounting information, /etc/hosts provides local hostname-to-address mappings, and /etc/shells lists recognized login shells. Understanding these files helps Linux administrators identify where different types of system configuration and login-related information are stored.
Question: 242. What is the primary purpose of /etc/nologin when it exists on a Linux system?
- It permanently deletes all user accounts
2. It disables networking during system startup
3. It prevents ordinary users from logging in while allowing appropriate administrative access
4. It changes the default command shell for every user
Correct Answer: 3. It prevents ordinary users from logging in while allowing appropriate administrative access
Explanation:
The /etc/nologin file is commonly used to temporarily prevent non-privileged users from logging into a Linux system. If the file exists, login programs may display its contents as a message explaining why logins are unavailable. This can be useful during maintenance, shutdown, or other administrative activities. Its presence does not mean that user accounts have been deleted or permanently disabled. The exact behavior depends on the authentication and login mechanisms in use. For Linux administration purposes, the important concept is that /etc/nologin can temporarily block ordinary user logins while allowing appropriate privileged access.
Question: 243. Which directory commonly contains programs intended primarily for system administration?
- /home
2. /tmp
3. /var/cache
4. /usr/sbin
Correct Answer: 4. /usr/sbin
Explanation:
The /usr/sbin directory traditionally contains system-administration commands intended primarily for use by administrators. These programs can be associated with system services, networking, account management, and other administrative functions. Modern Linux distributions may use a unified /usr filesystem layout, and directories such as /sbin may be symbolic links or merged into /usr/sbin. Nevertheless, the conventional filesystem meaning remains important for Linux certification questions. /home normally contains user directories, /tmp stores temporary files, and /var/cache stores regenerable cached data. Knowing these distinctions helps administrators navigate the filesystem efficiently.
Question: 244. What is the typical purpose of the /lib64 directory on a 64-bit Linux system?
- It commonly contains 64-bit shared libraries required by programs
2. It stores users’ home directories
3. It contains system log files
4. It stores temporary application files
Correct Answer: 1. It commonly contains 64-bit shared libraries required by programs
Explanation:
On systems using a traditional filesystem hierarchy, /lib64 commonly contains 64-bit shared libraries and related runtime components needed by 64-bit programs. Shared libraries allow multiple programs to use common code rather than storing separate copies inside every application. The precise filesystem organization varies between Linux distributions and architectures, and modern systems may use a unified /usr layout. However, the conventional role of /lib64 is associated with 64-bit libraries. It should not be confused with /var/log, which is used for logs, or /home, which normally contains personal user directories and data.
Question: 245. Which directory is commonly used for cached application or package data that can generally be regenerated?
- /boot
2. /dev
3. /var/cache
4. /var/spool
Correct Answer: 3. /var/cache
Explanation:
The /var/cache directory is conventionally used for cached data generated by applications and system services. Cache data can improve performance by preventing software from repeatedly downloading, calculating, or generating the same information. A major characteristic of cache data is that it can generally be regenerated if removed, although deleting it may temporarily reduce performance or require data to be recreated. /var/spool instead contains queued data waiting for processing, while /boot contains boot-related files and /dev provides device-related entries. Understanding the purpose of directories under /var helps administrators locate frequently changing system data.
Question: 246. What type of data is conventionally stored under /var/spool?
- Kernel source code
2. Files waiting in queues for later processing
3. User home directories
4. Bootloader configuration only
Correct Answer: 2. Files waiting in queues for later processing
Explanation:
The /var/spool directory is traditionally used for data waiting to be processed by a system service or application. Examples include print jobs waiting for a printer, mail waiting for delivery, and other queued tasks. Spooling allows one component to produce data while another component processes it later. This differs from /var/cache, where information is primarily stored to improve performance and can generally be regenerated. /var/spool belongs to the variable-data hierarchy because its contents may change frequently as jobs are added, processed, and removed. Recognizing spool directories is useful when troubleshooting queued services.
Question: 247. Which directory is intended for temporary files that may persist longer than files in /tmp?
- /usr
2. /etc
3. /boot
4. /var/tmp
Correct Answer: 4. /var/tmp
Explanation:
The /var/tmp directory is traditionally intended for temporary files that may need to survive system reboots. This differs from /tmp, which is generally intended for temporary data and may be cleaned more aggressively depending on system configuration. The exact cleanup behavior varies between distributions and administrators’ configurations, but the traditional distinction is that /var/tmp provides a more persistent temporary storage location. It should not be treated as permanent storage for important information. Because /var/tmp is under /var, its contents can change frequently. This distinction is useful when deciding where scripts and applications should store temporary data.
Question: 248. Which option causes ls to display file sizes in a human-readable format?
- ls -R
2. ls -a
3. ls -F
4. ls -h
Correct Answer: 4. ls -h
Explanation:
The -h option of ls requests human-readable size formatting, especially when combined with a long listing such as ls -lh. Instead of displaying large raw byte counts that can be difficult to interpret, the command can show values using units such as K, M, or G. The -a option displays hidden entries, -R recursively lists directory contents, and -F adds file-type indicators. Therefore, ls -h is the appropriate option when the goal is easier interpretation of file sizes. It is commonly combined with other ls options during interactive filesystem inspection.
Question: 249. What does ls -R do?
- It recursively lists the contents of directories and their subdirectories
2. It displays only hidden files
3. It reverses filename sorting
4. It displays file sizes in gigabytes
Correct Answer: 1. It recursively lists the contents of directories and their subdirectories
Explanation:
The -R option tells ls to list directory contents recursively. When the specified directory contains subdirectories, ls -R also displays the contents of those subdirectories and continues into deeper directory levels. This can provide a quick textual overview of a directory tree. It differs from -a, which displays hidden entries, and -h, which changes size formatting. Recursive listings can become very large on directories containing many files or deeply nested structures, so the command should be used carefully on large filesystem trees. Nevertheless, it is useful when examining directory structures from the command line.
Question: 250. What does ls -F commonly add to directory listings?
- Full inode information
2. File contents after every filename
3. File-type indicators such as / for directories
4. Detailed ownership information
Correct Answer: 3. File-type indicators such as / for directories
Explanation:
The -F option causes ls to append indicators to certain filenames so that users can identify file types more easily. For example, directories commonly receive a trailing slash, while executable files may receive an asterisk. Symbolic links can also receive a suitable indicator. The option does not display file contents or replace the detailed ownership and permission information provided by ls -l. Its purpose is to make a normal directory listing easier to interpret visually. This can be particularly convenient when working interactively and quickly distinguishing directories, executable files, and symbolic links.
Question: 251. Which command can resolve a symbolic link to its final target path?
- echo
2. readlink -f
3. dirname
4. basename
Correct Answer: 2. readlink -f
Explanation:
The readlink -f command can follow symbolic links and produce a canonicalized absolute pathname for the final target when the relevant path components can be resolved. This is particularly useful in scripts that need to determine the actual location of a file or directory referenced through symbolic links. dirname extracts the directory portion of a pathname, while basename extracts the final component. echo simply writes its arguments to standard output. The exact behavior of canonicalization can depend on whether path components exist, but readlink -f is the standard command associated with fully resolving symbolic-link paths.
Question: 252. What is an important property of a hard link compared with a symbolic link?
- It always points to a different inode
2. It becomes broken when another filename is removed
3. It can normally cross filesystem boundaries
4. It normally cannot cross filesystem boundaries
Correct Answer: 4. It normally cannot cross filesystem boundaries
Explanation:
A hard link is another directory entry referring to the same inode as an existing file. Since an inode belongs to a particular filesystem, a hard link normally cannot be created across filesystem boundaries. Removing one filename does not remove the underlying file if another hard link still references the same inode. A symbolic link works differently because it stores a pathname and can generally refer to a target located on another filesystem. Hard links also have additional restrictions, including the normal prohibition against creating hard links to directories for ordinary users. These properties distinguish hard links from symbolic links.
Question: 253. What is an inode in a Unix-like filesystem?
- A data structure containing filesystem metadata about a file
2. A network address assigned to a computer
3. A kernel process identifier
4. A shell variable containing the current directory
Correct Answer: 1. A data structure containing filesystem metadata about a file
Explanation:
An inode is a filesystem data structure containing metadata about a filesystem object. Depending on the filesystem, this information can include ownership, permissions, timestamps, file type, and references used to locate the object’s data. The filename itself is normally stored in a directory entry that maps the name to an inode number. This explains why multiple hard links can have different filenames while referring to the same underlying inode. Inodes are fundamental to understanding Unix-like filesystem behavior. Although the exact implementation varies by filesystem, the concept of an inode as an identity and metadata structure is central to Linux administration.
Question: 254. What is the purpose of du -sh when used with a directory?
- It changes directory permissions
2. It removes unused files
3. It displays the total disk usage of the directory in a human-readable form
4. It displays all running processes
Correct Answer: 3. It displays the total disk usage of the directory in a human-readable form
Explanation:
The du -sh command provides a concise summary of disk usage for a specified directory. The -s option requests a summary rather than reporting every nested file and directory individually, while -h formats the result using human-readable units. This makes the command useful when determining how much storage a directory hierarchy is consuming. du focuses on usage associated with files and directories, whereas df reports available and used space at the filesystem level. The command does not modify permissions or delete data. It is primarily an inspection tool for understanding storage consumption.
Question: 255. What does the -h option commonly do when used with df?
- It changes the filesystem type
2. It displays filesystem space values in human-readable units
3. It deletes unused filesystem blocks
4. It hides mounted filesystems
Correct Answer: 2. It displays filesystem space values in human-readable units
Explanation:
The -h option of df requests human-readable formatting for filesystem space information. Instead of presenting large raw values that may be difficult to interpret, the command can display sizes using units such as K, M, G, or T. A command such as df -h is therefore convenient for quickly checking filesystem capacity, used space, available space, and utilization. The option does not modify the filesystem, delete data, or hide mounted filesystems. It only changes how the reported values are presented, making storage information easier for administrators to read and understand.
Question: 256. What is a mount point in Linux?
- A process that automatically mounts every disk
2. A user account used for mounting devices
3. A special type of executable file
4. A directory where a filesystem is attached and made accessible
Correct Answer: 4. A directory where a filesystem is attached and made accessible
Explanation:
A mount point is a directory in the existing Linux filesystem hierarchy where another filesystem is attached and made accessible. After mounting, the contents of the mounted filesystem can be accessed through that directory. For example, a separate filesystem might be mounted at /mnt/data or another suitable directory. The mount point is not itself a special executable program or user account. Linux presents multiple filesystems through a unified directory tree, and mounting provides the connection between a filesystem source and a location within that tree. Understanding mount points is essential for disk and filesystem administration.
Question: 257. What does mount -a generally do?
- It attempts to mount appropriate filesystems listed in /etc/fstab
2. It formats every available disk
3. It removes all existing mounts
4. It lists only unmounted devices
Correct Answer: 1. It attempts to mount appropriate filesystems listed in /etc/fstab
Explanation:
The mount -a command tells the mount utility to attempt mounting filesystems listed in /etc/fstab that are configured for automatic mounting. Entries marked with options such as noauto are excluded from this automatic process. The command can be useful after modifying /etc/fstab because it allows an administrator to activate or test configured mounts without rebooting. It does not format disks or remove existing mounts. Because incorrect /etc/fstab entries can cause errors, administrators should carefully review the configuration before running mount -a, particularly on systems where filesystem availability is important.
Question: 258. In the output of ps, what does a process state of Z generally indicate?
- The process is actively running
2. The process is sleeping normally
3. The process is a zombie waiting for its parent to collect its exit status
4. The process is stopped by a terminal
Correct Answer: 3. The process is a zombie waiting for its parent to collect its exit status
Explanation:
A process with a Z state is generally a zombie process. The process has already terminated and is no longer executing, but its process-table entry remains because the parent process has not yet collected its termination status through an appropriate wait operation. Zombies therefore do not continue consuming CPU time like running processes, although they occupy process-table resources. Resolving a zombie usually involves addressing the parent process or the software responsible for failing to reap child processes. Sending ordinary termination signals to the zombie itself does not make it resume execution because the process has already exited.
Question: 259. Which signal is sent by kill -9?
- SIGTERM
2. SIGSTOP
3. SIGCONT
4. SIGKILL
Correct Answer: 4. SIGKILL
Explanation:
The command kill -9 sends signal number 9, which is SIGKILL on standard Linux systems. Unlike SIGTERM, SIGKILL cannot be caught, blocked, or handled by the target process, so it causes immediate termination at the operating-system level. This means the application does not receive an opportunity to perform its normal cleanup procedures. For that reason, administrators generally prefer a graceful termination signal when possible and use SIGKILL when a process does not respond appropriately. SIGSTOP stops a process, while SIGCONT resumes a process that has been stopped.
Question: 260. Which shell parameter represents the number of positional parameters supplied to a shell script or function?
- $PWD
2. $#
3. $?
4. $0
Correct Answer: 2. $#
Explanation:
The special shell parameter $# contains the number of positional parameters supplied to a shell script or function. For example, if a script receives three command-line arguments, $# evaluates to 3. Individual arguments can be accessed through $1, $2, $3, and so forth. $0 generally represents the name used to invoke the script, while $? contains the exit status of the most recently executed command. $PWD normally contains the current working directory. The $# parameter is therefore particularly useful for validating the number of arguments before a script begins processing them.