101-500 無料問題集「Lpi LPIC-1 Exam 101, Part 1 of 2, version 5.0」
Following the Filesystem Hierarchy Standard (FHS), where should binaries that have been compiled by the system administrator be placed in order to be made available to all users on the system?
正解:
/usr/local/bin/
Explanation
According to the Filesystem Hierarchy Standard (FHS), the /usr/local/ directory is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. The /usr/local/bin/ directory is for local binaries that are not managed by the distribution package manager. These binaries should be accessible to all users on the system. Therefore, binaries that have been compiled by the system administrator should be placed in /usr/local/bin/ to follow the FHS. References:
* Filesystem Hierarchy Standard - Linux Foundation
* Filesystem Hierarchy Standard (FHS) | Linux# - Geek University
Explanation
According to the Filesystem Hierarchy Standard (FHS), the /usr/local/ directory is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. The /usr/local/bin/ directory is for local binaries that are not managed by the distribution package manager. These binaries should be accessible to all users on the system. Therefore, binaries that have been compiled by the system administrator should be placed in /usr/local/bin/ to follow the FHS. References:
* Filesystem Hierarchy Standard - Linux Foundation
* Filesystem Hierarchy Standard (FHS) | Linux# - Geek University
Which file from the /proc file system contains a list of all currently mounted devices? (Specify ONLY the command without any path or parameters.)
正解:
mounts
Explanation
The file /proc/mounts contains a list of all currently mounted devices in the system. It is a pseudo-file that is dynamically generated by the kernel and reflects the actual state of the mount table. It has a similar format to
/etc/fstab, but shows the actual mount options and file system types used by the kernel. The file/proc/mounts can be read by any user, but only the root user can modify it. The file /proc/mounts is also known as
/proc/self/mounts, which is a symbolic link to the mounts file for the current process. References:
* Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
* How to get the complete and exact list of mounted filesystems in Linux?
* The /proc Filesystem
Explanation
The file /proc/mounts contains a list of all currently mounted devices in the system. It is a pseudo-file that is dynamically generated by the kernel and reflects the actual state of the mount table. It has a similar format to
/etc/fstab, but shows the actual mount options and file system types used by the kernel. The file/proc/mounts can be read by any user, but only the root user can modify it. The file /proc/mounts is also known as
/proc/self/mounts, which is a symbolic link to the mounts file for the current process. References:
* Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
* How to get the complete and exact list of mounted filesystems in Linux?
* The /proc Filesystem
Which program updates the database that is used by the locate command?
正解:
updated
Explanation
The program that updates the database that is used by the locate command is updatedb. The updatedb command creates or updates a database of filenames and directories that can be searched by the locate command. The updatedb command is usually run daily by cron to update the default database, which is stored in /var/lib/mlocate/mlocate.db. The updatedb command can also take some options, such as the filesystem type, the prune list, and the output file. For more information, see the updatedb man page1 or the Ubuntu man page2.
Explanation
The program that updates the database that is used by the locate command is updatedb. The updatedb command creates or updates a database of filenames and directories that can be searched by the locate command. The updatedb command is usually run daily by cron to update the default database, which is stored in /var/lib/mlocate/mlocate.db. The updatedb command can also take some options, such as the filesystem type, the prune list, and the output file. For more information, see the updatedb man page1 or the Ubuntu man page2.