Prepare 101-500 Question Answers Free Update With 100% Exam Passing Guarantee [Q54-Q75]

Share

Prepare 101-500 Question Answers Free Update With 100% Exam Passing Guarantee [2024]

Dumps Real Lpi 101-500 Exam Questions [Updated 2024]

NEW QUESTION # 54
Which file from the /proc file system contains a list of all currently mounted devices? (Specify ONLY the command without any path or parameters.)

Answer:

Explanation:
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


NEW QUESTION # 55
Which variable defines the directories in which a Bash shell searches for executable commands?

  • A. PATH
  • B. BASHEXEC
  • C. PATHRC
  • D. BASHRC
  • E. EXECPATH

Answer: A

Explanation:
Explanation
The PATH variable defines the directories in which a Bash shell searches for executable commands.
The PATH variable is a colon-separated list of directories that the shell scans when a command is entered. For example, if the PATH variable is set to /usr/local/bin:/usr/bin:/bin, then the shell will look for the command in these three directories, in order. If the command is not found in any of these directories, the shell will report an error message. The other options are either invalid or do not perform the desired task.
The BASHEXEC, EXECPATH and PATHRC variables are not valid Bash variables. The BASHRC variable is used to specify a file that is executed whenever a new interactive shell is started, but it does not affect the command search path. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.1 Work on the command line
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)


NEW QUESTION # 56
Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting?

  • A. tune2fs -i 200 /dev/sda1
  • B. tune2fs -c 200 /dev/sda1
  • C. tune2fs --days 200 /dev/sda1
  • D. tune2fs -d 200 /dev/sda1
  • E. tune2fs -n 200 /dev/sda1

Answer: A

Explanation:
Explanation
The correct command to change the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting is tune2fs -i 200 /dev/sda1. This command sets the interval between two filesystem checks to 200 days. The tune2fs command allows you to view and change various filesystem parameters on Linux ext2, ext3, or ext4 filesystems. The -i option specifies the time interval between checks.
The other options are incorrect because they use the wrong parameters for the tune2fs command. Option A is wrong because the -d option is not supported by the tune2fs command. Option B is wrong because the -c option sets the maximum number of mounts, not days, before a check. Option D is wrong because the -n option is not supported by the tune2fs command. Option E is wrong because the --days option is not supported by the tune2fs command. References:
* [LPI Linux Essentials - 2.2 Mounting, Unmounting Filesystems]
* 15 tune2fs command examples in Linux [Cheat Sheet] - GoLinuxCloud
* Linux tune2fs command With Examples - GeeksforGeeks
* tune2fs command-file system management - Linuxstar
* tune2fs Command Examples - Gianforte School of Computing


NEW QUESTION # 57
The USB device filesystem can be found under /proc/______/usb/. (Please fill in the blank with the single word only)

Answer:

Explanation:
bus


NEW QUESTION # 58
In compliance with the FHS, in which of the following directories are documentation files found?

  • A. /var/share/doc
  • B. /usr/share/documentation
  • C. /etc/share/doc
  • D. /usr/share/doc
  • E. /usr/local/share/documentation

Answer: D

Explanation:
Explanation
According to the FHS (Filesystem Hierarchy Standard), the /usr/share/doc directory is used to store documentation files for various packages installed on the system. The documentation files may include README files, manuals, license agreements, changelogs, etc. The /usr/share/doc directory is intended to be read-only and independent of the machine architecture. The other directories are not compliant with the FHS or do not exist by default. The /usr/share/documentation directory is not a standard directory and may not be recognized by some applications. The /usr/local/share/documentation directory is also not a standard directory and may conflict with the /usr/local/share/doc directory, which is used for documentation files for locally installed packages. The /var/share/doc directory does not exist by default and is not a valid subdirectory of
/var, which is used for variable data files. The /etc/share/doc directory does not exist by default and is not a valid subdirectory of /etc, which is used for configuration files. References:
* LPI 101-500 Exam Objectives, Topic 101.3, Weight 2
* LPI Learning Materials, Chapter 1.3, Finding Linux Documentation
* Web Search Results, 1


NEW QUESTION # 59
Which of the following commands displays the output of the foo command on the screen and also writes it to a file called /tmp/foodata?

  • A. foo > stdout >> /tmp/foodata
  • B. foo > /tmp/foodata
  • C. foo | tee /tmp/foodata
  • D. foo | less /tmp/foodata
  • E. foo | cp /tmp/foodata

Answer: C

Explanation:
Explanation
This command will display the output of the foo command on the screen and also write it to a file called
/tmp/foodata. The syntax of the command is:
foo | tee [options] [file]
The foo command is any command that produces some output. The | symbol is a pipe operator that redirects the standard output of one command to the standard input of another command. The tee command reads from the standard input and writes to both the standard output and one or more files. The options can modify the behavior of the tee command, such as appending to the file instead of overwriting it, or ignoring interrupt signals. The file is the name of the file to which the output is written. If no file is given, the tee command will only write to the standard output.
Therefore, the command foo | tee /tmp/foodata will run the foo command, pipe its output to the tee command, which will display the output on the screen and write it to the file /tmp/foodata.
The other commands are incorrect for the following reasons:
* A, foo | less /tmp/foodata: This command will not write the output of the foo command to a file, but it will display the output of the foo command on the screen in a pager. The less command is a program that allows the user to view and scroll through a file or the output of a command. The syntax of the command is:
foo | less [options] [file]
The foo command is any command that produces some output. The | symbol is a pipe operator that redirects the standard output of one command to the standard input of another command. The less command reads from the standard input or a file and displays it on the screen in a pager. The options can modify the behavior of the less command, such as setting the number of lines per screen, or searching for a pattern. The file is the name of the file to be viewed. If no file is given, the less command will read from the standard input.
Therefore, the command foo | less /tmp/foodata will run the foo command, pipe its output to the less command, which will display the output on the screen in a pager. However, the /tmp/foodata argument will be ignored by the less command, because it will read from the standard input instead of the file. The command will not write anything to the file /tmp/foodata.
* B, foo | cp /tmp/foodata: This command will not work as expected, because it has several errors. First, the cp command is not a valid command to write the output of a command to a file. The cp command is used to copy files or directories from one location to another. The syntax of the command is:
cp [options] source destination
The options can modify the behavior of the cp command, such as preserving the attributes of the files, or creating backups of the existing files. The source is the name of the file or directory to be copied. The destination is the name of the file or directory where the source is copied to.
Second, the pipe operator is not a valid way to redirect the output of a command to the cp command. The pipe operator redirects the standard output of one command to the standard input of another command. However, the cp command does not read from the standard input, but from the source argument. Therefore, the command foo | cp /tmp/foodata will run the foo command, pipe its output to the cp command, which will ignore the standard input and report an error for missing the destination argument. The command will not write anything to the file /tmp/foodata.
* C, foo > /tmp/foodata: This command will not display the output of the foo command on the screen, but it will write it to a file called /tmp/foodata. The > symbol is a redirection operator that redirects the standard output of a command to a file or device, overwriting any existing content. The syntax of the command is:
foo > file
The foo command is any command that produces some output. The > symbol redirects the standard output of the foo command to the file. The file is the name of the file to which the output is written.
Therefore, the command foo > /tmp/foodata will run the foo command, redirect its output to the file
/tmp/foodata, and overwrite any previous content. The command will not display anything on the screen.
* E, foo > stdout >> /tmp/foodata: This command will not work as expected, because it has several errors.
First, the stdout argument is not a valid file name or device name. The stdout is an abbreviation for the standard output, which is a stream that a program uses to write its output. However, the stdout is not a file or device that can be used as a destination for the redirection operator. Second, the >> symbol is a redirection operator that redirects the standard output of a command to a file or device, appending to any existing content. The syntax of the command is:
foo >> file
The foo command is any command that produces some output. The >> symbol redirects the standard output of the foo command to the file. The file is the name of the file to which the output is appended.
Therefore, the command foo > stdout >> /tmp/foodata will run the foo command, redirect its output to the stdout argument, which will cause an error, and then redirect its output again to the file /tmp/foodata, which will append the output to the file. The command will not display anything on the screen.
References:
* Linux Tee Command with Examples | Linuxize
* tee command in Linux with examples - GeeksforGeeks
* Linux tee command explained for beginners (6 examples) - HowtoForge
* Command Options and Examples of Tee Command in Linux - UbuntuPIT
* Linux tee Command Explained for Beginners (6 Examples) - Linux Handbook.


NEW QUESTION # 60
Which of the following commands will display the inode usage of each mounted filesystem?

  • A. lsfs -i
  • B. df -i
  • C. printfs -i
  • D. du -i

Answer: B

Explanation:
Explanation
The df command is used to report the disk space usage of the filesystems on a Linux system. The -i option is used to display the inode usage of each mounted filesystem. An inode is a data structure that stores the metadata of a file or directory, such as its size, owner, permissions, etc. Each filesystem has a fixed number of inodes, which limits the number of files and directories that can be created on it. The df -i command shows the total number of inodes, the number of used and free inodes, and the percentage of inode usage for each filesystem. For example:
[tcarrigan@rhel ~]$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda2 1310720 83167
1227553 7% / devtmpfs 249974 386 249588 1% /dev tmpfs 251374 1 251373 1% /dev/shm tmpfs 251374 570
250804 1% /run tmpfs 251374 16 251358 1% /sys/fs/cgroup /dev/sda1 524288 312 523976 1% /boot tmpfs
251374 1 251373 1% /run/user/1000
The other options are not valid commands or options. The du command is used to estimate the disk usage of files and directories, but it does not have an -i option. The lsfs and printfs commands do not exist on a standard Linux system. References:
* Inodes and the Linux filesystem | Enable Sysadmin
* filesystems - Find where inodes are being used - Unix & Linux Stack ...
* filesystems - How much space does an inode occupy? - Unix & Linux Stack ...


NEW QUESTION # 61
A Debian package creates several files during its installation. Which of the following commands searches for packages owning the file /etc/debian_version?

  • A. apt-file /etc/debian_version
  • B. apt -r /etc/debian_version
  • C. dpkg -S /etc/debian_version
  • D. find /etc/debian_version -dpkg
  • E. apt-get search /etc/debian_version

Answer: D


NEW QUESTION # 62
A faulty kernel module is causing issues with a network interface card. Which of the following actions ensures that this module is not loaded automatically when the system boots?

  • A. Deleting the kernel module's directory from the file system and recompiling the kernel, including its modules
  • B. Using modinfo -k followed by the name of the offending module
  • C. Using modprobe -r followed by the name of the offending module
  • D. Adding a blacklist line including the name of the offending module to the file
    /etc/modprobe.d/blacklist.conf
  • E. Using lsmod --remove --autoclean without specifying the name of a specific module

Answer: D


NEW QUESTION # 63
When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: D

Explanation:
Explanation
When starting a program with the nice command without any additional parameters, the nice level is set to 10 for the resulting process. This means that the process will have a lower priority than the default value of 0, and will be more willing to yield CPU time to other processes. The nice command can also take an optional argument -n followed by a number, which specifies the increment or decrement of the nice value from the default value of 0. For example, the command:
nice -n 5 /usr/bin/prog
will start the /usr/bin/prog process with a nice value of 5, which means a lower priority than the default.
Similarly, the command:
nice -n -5 /usr/bin/prog
will start the /usr/bin/prog process with a nice value of -5, which means a higher priority than the default. If the -n argument is omitted, the nice command will assume a default increment of 10. For example, the command:
nice /usr/bin/prog
will start the /usr/bin/prog process with a nice value of 10, which means a very low priority. Note that only the root user can start a process with a negative nice value, as this requires special privileges.
References:
* [LPI Exam 101 Detailed Objectives], Topic 103: GNU and Unix Commands, Objective 103.6: Modify process execution priorities, Weight: 2, Key Knowledge Areas: Know the default priority of a job that is created.
* How to Set Process Priorities With nice and renice on Linux, Topic: The nice Command.


NEW QUESTION # 64
Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)

  • A. chmod 4775 /tmp
  • B. chmod +t /tmp
  • C. chmod 2775 /tmp
  • D. chmod 1775 /tmp
  • E. chmod +s /tmp

Answer: B,D


NEW QUESTION # 65
Which permissions and ownership should the file /etc/passwd have?

  • A. -rw-------1 11531 Jun 5 22:45 /etc/passwd
  • B. -rw-r--r--1 rootroot531 Jun 5 22:45 /etc/passwd
  • C. -rw-------1 rootroot531 Jun 5 22:45 /etc/passwd
  • D. -rw-r--r--1 11531 Jun 5 22:45 /etc/passwd

Answer: B

Explanation:
Explanation
The correct permissions and ownership for the file /etc/passwd are:
B: -rw-r-r-- 1 root root 531 Jun 5 22:45 /etc/passwd
The /etc/passwd file is a plain text-based database that contains information for all user accounts on the system. It is owned by root and has 644 permissions. The file can only be modified by root or users with sudo privileges and readable by all system users. The permissions and ownership of the file are important for the security and functionality of the system. The permissions and ownership of the file can be viewed by using the ls -l command. For example:
ls -l /etc/passwd
The output of the command will show the following information:
-rw-r-r-- 1 root root 531 Jun 5 22:45 /etc/passwd
The first column shows the permissions of the file, which are composed of 10 characters. The first character indicates the file type, which is - for regular files. The next nine characters indicate the permissions for the user (owner), the group, and the others, respectively. Each set of three characters indicates the read , write (w), and execute (x) permissions. A dash (-) means no permission. In this case, the permissions are:
* rw- for the user, which means the user can read and write the file, but not execute it.
* r-- for the group, which means the group can only read the file, but not write or execute it.
* r-- for the others, which means the others can only read the file, but not write or execute it.
The second and third columns show the owner and the group of the file, which are both root. The root user is the superuser or the administrator of the system, who has full access and control over the system. The root group is the primary group of the root user, which usually has no other members.
The fourth column shows the size of the file in bytes, which is 531 in this case. The fifth and sixth columns show the date and time of the last modification of the file, which are Jun 5 22:45 in this case. The last column shows the name of the file, which is /etc/passwd in this case.
The other options are not correct because:
* A: -rw------- 1 root root 531 Jun 5 22:45 /etc/passwd: This option has the wrong permissions for the file.
The permissions are 600, which means only the user (root) can read and write the file, and the group and the others have no permissions at all. This would prevent the system users from reading the file, which would cause problems for the login process and other utilities that rely on the file.
* C: -rw-r-r-- 1 1 531 Jun 5 22:45 /etc/passwd: This option has the wrong owner and group for the file.
The owner and group are both 1, which is the numeric ID of the user and group. However, the numeric ID of the root user and group is 0, not 1. The user and group with the numeric ID of 1 are usually bin, which is a system user and group that own some system binaries and directories. Thebin user and group should not own the /etc/passwd file, as this would compromise the security and functionality of the system.
* D: -rw------- 1 1 531 Jun 5 22:45 /etc/passwd: This option has both the wrong permissions and the wrong owner and group for the file. The permissions are 600, which means only the user can read and write the file, and the owner and group are both 1, which is the numeric ID of the bin user and group.
This would prevent the system users from reading the file, and give the bin user and group full access to the file, which would cause problems for the security and functionality of the system.


NEW QUESTION # 66
Which of the following commands lists all currently installed packages when using RPM package management?

  • A. yum --list --installed
  • B. yum --query --all
  • C. rpm --query --all
  • D. rpm --query --list
  • E. rpm --list --installed

Answer: C

Explanation:
Explanation


NEW QUESTION # 67
What do the permissions -rwSr-xr-x mean for a binary file when it is executed as a command?

  • A. The command will be executed with the effective rights of the group instead of the owner.
  • B. The command is SetUID and it will be executed with the effective rights of the owner.
  • C. The execute flag is not set for the owner. Therefore, the SetUID flag is ignored.
  • D. The command will be executed with the effective rights of the owner and group.

Answer: C

Explanation:
Explanation
The permissions -rwSr-xr-x mean that the file is readable and writable by the owner, readable and executable by the group, and readable and executable by others. The S in the owner's permissions indicates that the file has the SetUID bit set, which means that when the file is executed as a command, it will run with the effective user ID of the file owner, rather than the user who executed it. This allows the command to perform privileged operations that the user normally cannot do. For example, the /bin/passwd commandhas the SetUID bit set, so that it can modify the /etc/shadow file, which is only writable by root. References: LPI Linux Administrator, File Permissions and Attributes


NEW QUESTION # 68
Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.)

  • A. find /tmp -user root
  • B. find -path /tmp -user root -print
  • C. find -path /tmp -uid root
  • D. find /tmp -user root -print
  • E. find /tmp -uid root -print

Answer: A,D


NEW QUESTION # 69
What is the correct way to set the default systemd boot target to multi-user?

  • A. systemctl set-runlevel multi-user.target
  • B. systemctl isolate multi-user.target
  • C. systemctl set-boot multi-user.target
  • D. systemctl set-default multi-user.target
  • E. systemctl boot -p multi-user.target

Answer: D


NEW QUESTION # 70
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?

  • A. rmdir '~/\dir'
  • B. rmdir "~/\dir"
  • C. rmdir ~/\dir
  • D. rmdir ~/\\dir
  • E. rmdir ~/'dir'

Answer: D

Explanation:
Explanation
The rmdir command removes an empty directory. To remove a directory whose name contains a backslash, the backslash must be escaped with another backslash. Therefore, the correct command is rmdir ~/\dir. The other commands will either fail to find the directory or interpret the backslash as part of a path name. References:
* [LPI Linux Essentials - 1.3 Basic Editing]
* [LPI Linux Essentials - 1.4 I/O Redirection]
* [LPI Linux Essentials - 1.5 Manage Simple Partitions and Filesystems]


NEW QUESTION # 71
Consider the following directory:
drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales
Which command ensures new files created within the directory salesare owned by the group sales?
(Choose two.)

  • A. chmod g+ssales
  • B. chgrp -p sales sales
  • C. chown --persistent *.sales sales
  • D. chmod 2775 sales
  • E. setpol -R newgroup=sales sales

Answer: A,D


NEW QUESTION # 72
A Debian package creates several files during its installation. Which of the following commands searches for packages owning the file /etc/debian_version?

  • A. apt-file /etc/debian_version
  • B. apt -r /etc/debian_version
  • C. dpkg -S /etc/debian_version
  • D. find /etc/debian_version -dpkg
  • E. apt-get search /etc/debian_version

Answer: C

Explanation:
Explanation
The command that searches for packages owning the file /etc/debian_version is dpkg -S /etc/debian_version.
The dpkg command is the low-level tool for installing, removing, configuring, and querying Debian packages.
The -S or --search option takes a file name or a pattern as an argument and searches for the packages that contain the matching files. The output shows the package name and the file name separated by a colon. For example, running dpkg -S /etc/debian_version will produce the output base-files:/etc/debian_version, indicating that the file /etc/debian_version belongs to the base-files package. The other commands are either invalid or do not perform the desired task. The apt-get command is used to download and install packages from the Debian repositories, but it does not have a search option. The aptcommand is a high-level tool for managing packages, but it does not have a -r option. The find command is used to search for files in the file system, but it does not have a -dpkg option. The apt-file command is used to search for files in the packages available in the Debian repositories, but it requires a subcommand such as search or show before the file name or pattern. References:
* Linux Essentials - Linux Professional Institute Certification Programs1
* Exam 101 Objectives - Linux Professional Institute2
* dpkg(1) - Linux manual page3
* apt-get(8) - Linux manual page
* apt(8) - Linux manual page
* find(1) - Linux manual page
* apt-file(1) - Linux manual page


NEW QUESTION # 73
Which of the following commands will load a kernel module along with any required dependency modules?

  • A. module_install
  • B. depmod
  • C. insmod
  • D. modprobe
  • E. loadmod

Answer: D

Explanation:
Explanation
The modprobe command is used to add or remove modules from the Linux kernel. The modprobe command can automatically resolve and load the dependencies of a module, which are the other modules that the module depends on. The modprobe command reads the modules.dep file, which is generated by the depmod command, to determine the dependencies of a module. The syntax of the modprobe command is:
modprobe [options] module [module parameters]
The module is the name of the module to be loaded or removed. The module parameters are optional arguments that can modify the behavior of the module. The options are optional, and they can modify the behavior of the modprobe command, such as displaying the dependencies, listing the modules, or specifying the configuration file.
For example, to load the e1000e module, which is a driver for Intel Gigabit Ethernet adapters, along with any required dependency modules, use the following command:
modprobe e1000e
This command will load the e1000e module and any other modules that it depends on, such as the crc32c module. You can verify the loaded modules by using the lsmod command, which lists the modules and their dependencies, sizes, and usage counts.
The other options are not correct because:
* A. depmod: This command is used to generate the modules.dep file, which contains the dependency information for the modules. The depmod command does not load or remove any modules, but it prepares the modules.dep file for the modprobe command to use. The depmod command is usually run automatically when a new kernel or module is installed, and it does not need to be run manually by the user.
* B. insmod: This command is used to insert a single module into the kernel. The insmod command does not resolve or load any dependencies of the module, and it requires the full path to the module file as an argument. The insmod command is a low-level command that is rarely used by the user, and it is usually invoked by the modprobe command internally.
* D. module_install: This command does not exist in the Linux system. There is no such command as module_install in the Linux documentation or the man pages.
* E. loadmod: This command does not exist in the Linux system. There is no such command as loadmod in the Linux documentation or the man pages.
References:
* modprobe(8) - Linux manual page
* How to Load and Unload Kernel Modules in Linux - Linux Handbook
* Linux Kernel Module Programming Guide - TLDP


NEW QUESTION # 74
Which of the following statements is correct regarding the command foo 1> bar?

  • A. The command foo receives its stdin from the file bar.
  • B. The command foo receives its stdin from the stdout of the command bar.
  • C. The stdout from the command foo is appended to the file bar.
  • D. The stderr from the command foo is saved to the file bar.
  • E. The stdout from the command foo overwrites the file bar.

Answer: E


NEW QUESTION # 75
......

101-500 Exam Dumps, 101-500 Practice Test Questions: https://www.trainingdump.com/Lpi/101-500-practice-exam-dumps.html

Free 101-500 Exam Dumps to Pass Exam Easily: https://drive.google.com/open?id=1s4TyVXbaWHf21Wip8bkac67kp2gIbzn_

0
0
0
0