[Jan-2024] Check your preparation for Lpi 101-500 On-Demand Exam
Practice Exam 101-500 Realistic Dumps Verified Questions
NEW QUESTION # 108
Which of the following is the device file name for the second partition on the only SCSI drive?
- A. /dev/sd1p2
- B. /dev/hda1
- C. /dev/sda2
- D. /dev/sd0a2
Answer: C
NEW QUESTION # 109
After successfully creating a hard link called bar to the ordinary file foo, foo is deleted from the filesystem.
Which of the following describes the resulting situation?
- A. The user is prompted whether bar should be removed, too.
- B. foo and bar would both be removed.
- C. Both foo and bar would remain accessible.
- D. foo would be removed while bar would remain accessible.
- E. foo would be removed. bar would still exist but would be unusable.
Answer: D
NEW QUESTION # 110
Which of the following are valid stream redirection operators within Bash? (Choose THREE correct answers.)
- A. %>
- B. <<<
- C. >
- D. >>>
- E. <
Answer: A,E
Explanation:
Explanation
The <, > and %> are valid stream redirection operators within Bash. The < operator redirects the standard input of a command from a file or another command. For example, sort < names.txt will sort the lines of the file names.txt and print them to the standard output. The > operator redirects the standard output of a command to a file or another command, overwriting the file if it exists. For example, echo "Hello World" > greeting.txt will write the string "Hello World" to the file greeting.txt. The %> operator redirects the standard error of a command to a file or another command, overwriting the file if it exists. For example, ls foo %> errors.log will list the contents of the directory foo and write any error messages to the file errors.log. The other options are either invalid or do not perform the desired task. The <<< operator is not a valid Bash operator, but it is used in some other shells like Zsh to redirect a string literal as the standard input of a command. The >>> operator is not a valid Bash operator, but it is used in some programming languages like Python to denote a bitwise right shift operation. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.4 Use streams, pipes and redirects
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
NEW QUESTION # 111
Which of the following properties of an existing file changes when a hard link pointing to that file is created?
- A. Link count
- B. Inode number
- C. Permissions
- D. Modify timestamp
- E. File size
Answer: A
NEW QUESTION # 112
When in Normal mode in vi, which character can be used to begin a reverse search of the text?
- A. F
- B. ?
- C. s
- D. /
- E. r
Answer: B
NEW QUESTION # 113
You want to preview where the package file, apache-xml.i386.rpm, will install its files before installing it.
What command do you issue?
- A. rpm -qpl apache-xml.i386.rpm
- B. rpm -ql apache-xml.i386.rpm
- C. rpm -qp apache-xml.i386.rpm
- D. rpm -qv apache-xml.i386.rpm
Answer: A
NEW QUESTION # 114
An administrator has issued the following command:
grub-install --root-directory=/custom-grub /dev/sda
In which directory will new configuration files be found? (Provide the full directory path only without the filename)
Answer:
Explanation:
/custom-grub/boot/grub/, /custom-grub/boot/grub
NEW QUESTION # 115
Which of the following command lines creates or, in case it already exists, overwrites a file called data with the output of ls?
- A. ls > data
- B. ls >& data
- C. ls >> data
- D. ls 3> data
Answer: A
NEW QUESTION # 116
The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh.
What is the usual way to pass this change to the kernel from your boot loader?
- A. Pass start=/bin/sh on the kernel parameter line.
- B. Start in runlevel 1.
- C. Pass init=/bin/sh on the kernel parameter line.
- D. Pass /bin/sh on the kernel parameter line.
Answer: C
NEW QUESTION # 117
Which of the following are valid stream redirection operators within Bash? (Choose two.)
- A. %>
- B. 2>&1
- C. >>>
- D. #>
- E. <
Answer: B,E
NEW QUESTION # 118
Which command will uninstall a package but leave its configuration files in case the package is re-installed?
- A. dpkg -r pkgname
- B. dpkg -L pkgname
- C. dpkg -s pkgname
- D. dpkg -P pkgname
Answer: A
NEW QUESTION # 119
What information can the lspci command display about the system hardware? (Choose THREE correct answers.)
- A. System battery type
- B. PCI bus speed
- C. Device IRQ settings
- D. Ethernet MAC address
- E. Device vendor identification
Answer: B,C,E
Explanation:
Explanation
The lspci command can display information about the system hardware, such as:
* Device IRQ settings1: The lspci command can show the interrupt request (IRQ) number assigned to each device by using the -v option. The IRQ number indicates how the device communicates with the CPU.
* PCI bus speed2: The lspci command can show the speed of the PCI bus by using the -vv option. The speed is expressed in megahertz (MHz) or gigahertz (GHz) and indicates how fast the data can be transferred between the device and the bus.
* Device vendor identification3: The lspci command can show the name and identification number of the device vendor by using the -n or -nn option. The vendor identification helps to identify the manufacturer and model of the device.
References: 1: https://www.man7.org/linux/man-pages/man8/lspci.8.html 2:
https://phoenixnap.com/kb/lspci-command 3: https://en.wikipedia.org/wiki/Lspci
NEW QUESTION # 120
What is the process ID number of the init process on a SysV init based system?
- A. It is set to the current run level.
- B. 0
- C. 1
- D. 2
- E. It is different with each reboot.
Answer: B
Explanation:
Explanation
The process ID number of the init process on a SysV init based system is 1. The init process is the first process that runs on the system, and it is responsible for initializing the user-space environment and spawning all other processes. The init process is always the first process that runs on the system, and it has the process ID (PID) of 1. The PID is a unique identifier for each process on the system, and it is assigned by the kernel.
The PID of the init process is always 1, regardless of the reboot or the run level. You can verify the PID of the init process by using the ps command, which shows information about the processes on the system. For example, to show the PID, the user, the command, and the arguments of the init process, use the following command:
ps -p 1 -o pid,user,cmd
The output of the command will show something like:
PID USER CMD 1 root /sbin/init
This shows that the init process has the PID of 1, the user of root, and the command of /sbin/init.
References:
* [SysVinit - ArchWiki]
* [Process Management in Linux - GeeksforGeeks]
* [ps(1) - Linux manual page]
NEW QUESTION # 121
Which of the following files exist in a standard GRUB 2 installation? (Choose two.)
- A. /boot/grub/i386-pc/1vm.mod
- B. /boot/grub/grub.cfg
- C. /boot/grub/stages/stage0
- D. /boot/grub/linux/vmlinuz
- E. /boot/grub/fstab
Answer: A,B
Explanation:
Explanation
The files that exist in a standard GRUB 2 installation are /boot/grub/i386-pc/1vm.mod and
/boot/grub/grub.cfg. The /boot/grub/i386-pc/1vm.mod file is a GRUB 2 module that provides support forthe
1vm command, which allows loading a virtual machine image from a disk1. The /boot/grub/grub.cfg file is the main configuration file for GRUB 2, which contains the menu entries and options for the bootloader2. The other files are either non-existent or do not belong to GRUB 2. The /boot/grub/stages/stage0 file ispart of the GRUB legacy bootloader, which used a different architecture and naming scheme than GRUB 23. The
/boot/grub/fstab file is not a valid file name, as fstab is the name of the file system table file that isusually located in /etc directory4. The /boot/grub/linux/vmlinuz file is also not a valid file name, as vmlinuz is the name of the compressed Linux kernel image that is usually located in /boot directory5. References:
* GRUB 2 bootloader - Full tutorial - Dedoimedo1
* Grub2/Installing - Community Help Wiki - Official Ubuntu Documentation2
* GRUB bootloader - Full tutorial - Dedoimedo3
* fstab(5) - Linux manual page4
* vmlinuz(5) - Linux manual page5
NEW QUESTION # 122
Which of the following commands displays the manual page command from section 1?
- A. man -s 1 command
- B. man 1.command
- C. man command(1)
- D. man 1 command
- E. man command@1
Answer: D
NEW QUESTION # 123
After successfully creating a hard link called bar to the ordinary file foo, foo is deleted from the filesystem.
Which of the following describes the resulting situation?
- A. The user is prompted whether bar should be removed, too.
- B. foo and bar would both be removed.
- C. Both foo and bar would remain accessible.
- D. foo would be removed while bar would remain accessible.
- E. foo would be removed. bar would still exist but would be unusable.
Answer: D
Explanation:
Explanation
A hard link is a directory entry that refers to the same inode as another file. An inode is a data structure that stores the metadata and the location of the data blocks of a file. A hard link allows multiple names to refer to the same file content, as long as they are on the same filesystem. Therefore, when a hard link is created, the inode reference count is increased by one, and when a hard link is deleted, the inode reference count is decreased by one. The file content is only removed from the disk when the inode reference count reaches zero, meaning that there are no more hard links to the file. In this scenario, after successfully creating a hard link called bar to the ordinary file foo, foo and bar both refer to the same inode and the same file content. The inode reference count is two. When foo is deleted from the filesystem, the inode reference count is decreased by one, but it is still one, meaning that there is still one hard link to the file. Therefore, foo would be removed while bar would remain accessible. The file content would not be removed from the disk until bar is also deleted. The other options are either incorrect or not applicable. The user is not prompted whether bar should be removed, too. The bar link would still exist and be usable, not unusable. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.3 Perform basic file management
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
NEW QUESTION # 124
Which of the following commands displays the path to the executable file that would be executed when the command foois invoked?
- A. locate foo
- B. lsattr foo
- C. which foo
- D. whatis foo
- E. apropos foo
Answer: C
NEW QUESTION # 125
Which of the following are init systems used within Linux systems? (Choose THREE correct answers.)
- A. Upstart
- B. startd
- C. SysV init
- D. systemd
- E. SysInit
Answer: A,C,D
Explanation:
Explanation
systemd, Upstart, and SysV init are all init systems used within Linux systems. An init system is the first process executed by the kernel at boot time, which has a process ID (PID) of 1, and is responsible for starting and managing all other processes on the system. Different init systems have different features, advantages, and disadvantages. Some of the most common init systems are:
* systemd: A relatively new and modern init system that aims to provide a unified and efficient way of managing system and service states. It is compatible with SysV and LSB init scripts, and supports
* features such as parallel processing, socket activation, logging, job scheduling, and more. It is the default init system for many popular Linux distributions, such as Fedora, Debian, Ubuntu, Arch Linux, and others12.
* Upstart: An event-based init system developed by Ubuntu as a replacement for SysV init. It starts and stops system tasks and processes based on events, such as hardware changes, network availability, filesystem mounting, etc. It is a hybrid init system that uses both SysV and systemd scripts, and supports features such as parallel processing, dependency tracking, logging, and more. It is the default init system for some older versions of Ubuntu, and some other Linux distributions, such as Linux Mint and Chrome OS12.
* SysV init: A mature and traditional init system that follows the System V (SysV) design of Unix operating systems. It uses a series of runlevels to define the state of the system, and executes scripts in the /etc/rc.d or /etc/init.d directories according to the current runlevel. It is simple and stable, but lacks some features of modern init systems, such as parallel processing, event handling, dependency tracking, etc. It is still used by some Linux distributions, such as Slackware, Gentoo, and others12.
References: 1: 6 Best Modern Linux 'init' Systems (1992-2023) - Tecmint 2: 10 Best Linux init systems as of
2023 - Slant.
NEW QUESTION # 126
After running the command umount /mnt, the following error message is displayed:
umount: /mnt: device is busy.
What is a common reason for this message?
- A. A user has a file open in the /mnt directory.
- B. The files in /mnt have been scanned and added to the locate database.
- C. The kernel thinks that a process is about toopen a file in /mnt for reading.
- D. The kernel has not finished flushing disk writes to themounted device.
- E. Another file system still contains a symlink to a file inside /mnt.
Answer: A
NEW QUESTION # 127
Consider the following output from the command ls -i:
How would a new file named c.txt be created with the same inode number as a.txt(Inode 525385)?
- A. ln -i 525385 c.txt
- B. ln -f c.txt a.txt
- C. ln c.txt a.txt
- D. ln -h a.txt c.txt
- E. ln a.txt c.txt
Answer: E
NEW QUESTION # 128
What output will be displayed when the user fredexecutes the following command?
echo 'fred $USER'
fred fred
- A. 'fred $USER'
- B. 'fred fred'
- C.
- D. fred $USER
- E. fred /home/fred/
Answer: B
NEW QUESTION # 129
Which of the following properties of a Linux system should be changed when a virtual machine is cloned?
(Choose two.)
- A. The permissions of /root/
- B. The partitioning scheme
- C. The file system
- D. The SSH host keys
- E. The D-Bus Machine ID
Answer: A,D
NEW QUESTION # 130
Which of the following commands reboots the system when using SysV init? (Choose TWO correct answers.)
- A. shutdown -r now
- B. shutdown -k now "rebooting"
- C. shutdown -r "rebooting"
- D. telinit 0
- E. telinit 6
Answer: A,E
Explanation:
Explanation
The shutdown command is used to bring the system down in a safe and controlled way. It can take various options and arguments, such as the time of shutdown, the message to broadcast to users, the halt or reboot mode, etc. The option -r instructs the shutdown command to reboot the system after shutting down. The argument now means to shut down immediately. Therefore, shutdown -r now will reboot the system without delay. The telinit command is used to change the run level of the system. It takes a single argument that specifies the new run level. The run level 6 is reserved for rebooting the system. Therefore, telinit 6 will also reboot the system. The other options are either incorrect or irrelevant. shutdown -r "rebooting" will also reboot the system, but with a delay of one minute and a message to the users. telinit 0 will halt the system, not reboot it. shutdown -k now "rebooting" will only send a warning message to the users, but not actually shut down or reboot the system. References: LPI Linux Essentials - 1.101.2, LPI Linux Administrator - 101.3
NEW QUESTION # 131
Which of the following is true when a file system, which is neither listed in /etc/fstab nor known to system, is mounted manually?
- A. systemctl unmount must be used to remove the mount because system opens a file descriptor on the mount point
- B. systemd automatically generates a mount unit and monitors the mount point without changing it
- C. The command systemctl mountsync can be used to create a mount unit based on the existing mount
- D. systemd ignores any manual mounts which are not done using the systemctl mount command
- E. Unless a systemd mount unit is created, systemd unmounts the file system after a short period of time
Answer: B
Explanation:
Explanation
Systemd is a system and service manager for Linux systems, and it can manage the mounting and unmounting of file systems. Systemd can automatically create and start mount units for file systems that are listed in
/etc/fstab or are known to the system. Mount units are unit files that encode information about a file system mount point controlled and supervised by systemd. Mount units must be named after the mount point directories they control, and they have the suffix .mount. For example, the mount point /home must be configured in a unit file home.mount.
Systemd can also handle file systems that are neither listed in /etc/fstab nor known to the system, but are mounted manually by the user. In this case, systemd automatically generates a transient mount unit and monitors the mount point without changing it. A transient mount unit is a unit that is created dynamically and temporarily, and is not backed by a unit file on disk. A transient mount unit has the same name and properties as a regular mount unit, but it is not persistent across reboots. Systemd does not interfere with the manual mount, and does not unmount it unless explicitly requested by the user. The user can use the mount command or the systemd-mount command to create a manual mount, and the umount command or the systemd-umount command to remove it. The user can also use the systemctl command to inspect and control the transient mount unit. For example, to show the status of the transient mount unit for the mount point /mnt, use the following command:
systemctl status mnt.mount
References:
* systemd.mount - freedesktop.org
* systemd-mount - freedesktop.org
* How to name systemd mount unit properly? - Server Fault
* Working with Systemd Mount Units - Pluralsight
NEW QUESTION # 132
......
Valid 101-500 Dumps for Helping Passing Lpi Exam: https://www.itcertmagic.com/Lpi/real-101-500-exam-prep-dumps.html
Download Free Lpi 101-500 Exam Questions & Answer: https://drive.google.com/open?id=1w0CJKPPT-grcvKe6YpEK8JEwEAjIVMlb