Get Ready to Pass the 101-500 exam with Lpi Latest Practice Exam
Get Prepared for Your 101-500 Exam With Actual Lpi Study Guide!
NEW QUESTION # 44
What happens after issuing the command vi without any additional parameters?
- A. vi starts and requires the user to explicitly either create a new or load an existing file.
- B. vi exits with an error message as it cannot be invoked without a file name to operate on.
- C. vi starts and loads the last file used andmoves the cursor to the position where vi was when it last exited.
- D. vi starts and opens a new file which is filled with the content of the vi buffer if the buffer contains text.
- E. vi starts in command mode and opens a new empty file.
Answer: E
Explanation:
Explanation
The vi command is a text editor that operates in two modes: command mode and insert mode. Command mode is used to enter commands to manipulate the text, such as saving, quitting, copying, pasting, etc. Insert mode is used to enter text into the file. When the vi command is invoked without any additional parameters, it starts in command mode and opens a new empty file. To enter text, the user has to press i to switch to insert mode. To return to command mode, the user has to press Esc. To save and quit, the user has to enter :wq in command mode. The other options are either incorrect or not applicable. The vi command does not load the last file used or the content of the vi buffer by default. It also does not require the user to explicitly create or load a file. It does not exit with an error message unless there is a problem with the terminal or the system. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.7 Use and edit text files
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
NEW QUESTION # 45
What command changes the nice level of a running process?
(Specify ONLY the command without any path or parameters)
Answer:
Explanation:
renice
NEW QUESTION # 46
Which of the following commands displays the contents of a gzip compressed tar archive?
- A. tar ztf archive.tgz
- B. tar cf archive.tgz
- C. gzip archive.tgz | tar xvf -
- D. gzip -d archive.tgz | tar tvf -
Answer: A
Explanation:
Explanation
The command that displays the contents of a gzip compressed tar archive is tar ztf archive.tgz. This command uses the following options:
-z: Tells tar to read or write archives through gzip, allowing it to work on compressed files directly. -t: Lists the contents of an archive without extracting it. -f archive.tgz: Specifies the name of the archive file.
The output of this command will show the names of the files and directories stored in the archive, one per line.
For example, if the archive contains three files named file1, file2, and file3, the output will be:
file1 file2 file3
The other commands are incorrect for the following reasons:
* gzip archive.tgz | tar xvf -: This command will decompress the archive using gzip and pipe it to tar, which will extract the files to the current directory. The - option tells tar to read the archive from the standard input. This command does not display the contents of the archive, but rather extracts them.
* gzip -d archive.tgz | tar tvf -: This command is similar to the previous one, except that it uses the -d option for gzip to decompress the archive instead of compressing it, and the -t option for tar to list the contents instead of extracting them. However, this command is redundant and inefficient, as tar can handle compressed archives directly with the -z option. Also, the -d option for gzip will delete the original archive file after decompression, which may not be desirable.
* tar cf archive.tgz: This command will create a new archive named archive.tgz from the files and directories given as arguments. However, this command does not use the -z option, so the archive will not be compressed with gzip. Also, this command does not display the contents of the archive, but rather creates it.
NEW QUESTION # 47
Which command is used to create and initialize the files used to store quota information?
(Specify ONLY the command without any path or parameters.)
Answer:
Explanation:
quotacheck
NEW QUESTION # 48
Which of the following properties of a Linux system should be changed when a virtual machine is cloned?
(Choose two.)
- A. The partitioning scheme
- B. The D-Bus Machine ID
- C. The SSH host keys
- D. The permissions of /root/
- E. The file system
Answer: B,C
Explanation:
Explanation
The properties of a Linux system that should be changed when a virtual machine is cloned are the D-Bus Machine ID and the SSH host keys. The D-Bus Machine ID is a unique identifier for the system that is used by the D-Bus message bus system to communicate between applications. The D-Bus Machine ID is stored in the
/etc/machine-id or /var/lib/dbus/machine-id file and it is generated during the first boot of the system. If a virtual machine is cloned without changing the D-Bus Machine ID, it can cause conflicts and errors with the D-Bus services on the clone and the original system. To change the D-Bus Machine ID, the file containing it must be deleted or emptied and the system must be rebooted12. The SSH host keys are cryptographic keys that are used by the SSH protocol to authenticate the identity of the system and establish a secure connection. The SSH host keys are stored in the /etc/ssh directory and they are generated during the first boot of the system or the installation of the openssh-server package. If a virtual machine is cloned without changing the SSH host keys, it can compromise the security and integrity of the SSH connections, as the clone and the original system will have the same keys. To change the SSH host keys, the files containing them must be deleted and the ssh-keygen command must be run to generate new keys34.
The other options are false or irrelevant. The partitioning scheme and the file system are not properties of a Linux system that need to be changed when a virtual machine is cloned, as they do not affect the functionality or the identity of the system. The permissions of /root/ are also not properties of a Linux system that need to be changed when a virtual machine is cloned, as they do not affect the security or the communication of the system. References:
* Linux Essentials - Linux Professional Institute Certification Programs1
* Exam 101 Objectives - Linux Professional Institute2
* How to Clone Virtual Machine in VirtualBox - UbuntuMint3
* Chapter 4. Cloning Virtual Machines Red Hat Enterprise Linux 7 | Red ...4
NEW QUESTION # 49
Which of the following commands generates a list of user names from /etc/passwdalong with their login shell?
- A. colrm 1,7 /etc/passwd
- B. sort -t: -k1,7 /etc/passwd
- C. chop -c 1,7 /etc/passwd
- D. column -s : 1,7 /etc/passwd
- E. cut -d: -f1,7 /etc/passwd
Answer: E
NEW QUESTION # 50
Which of the following commands determines the type of a file by using a definition database file which contains information about all common file types?
- A. file
- B. pmagic
- C. magic
- D. type
- E. hash
Answer: A
NEW QUESTION # 51
Which of the following options is used in a GRUB Legacy configuration file to define the amount of time that the GRUB menu will be shown to the user?
- A. splash
- B. timeout
- C. showmenu
- D. hidemenu
Answer: B
Explanation:
Explanation
The timeout option in a GRUB Legacy configuration file is used to define the amount of time (in seconds) that the GRUB menu will be shown to the user before booting the default entry. The timeout option is usually located in the /boot/grub/menu.lst file. For example, timeout 10 will display the GRUB menu for 10 seconds.
To disable the timeout and wait for user input indefinitely, the value of timeout can be set to -1. To boot immediately without displaying the menu, the value of timeout can be set to 0. The other options are not valid for the GRUB Legacy configuration file. References:
* GRUB Legacy - ArchWiki
* How do I set the grub timeout and the grub default boot entry?
* How to Remove the Timeout From GRUB Menu
NEW QUESTION # 52
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. Another file system still contains a symlink to a file inside /mnt.
- B. The kernel thinks that a process is about to open a file in /mnt for reading.
- C. The kernel has not finished flushing disk writes to themounted device.
- D. A user has a file open in the /mnt directory.
- E. The files in /mnt have been scanned and added to the locate database.
Answer: D
Explanation:
Explanation
One of the common reasons for the error message "device is busy" when trying to unmount a file system is that a user or a process has a file open in the mounted directory. This prevents the kernel from releasing the file system resources and detaching the device. To find out which user or process is holding the file system, one can use the lsof or fuser commands12. For example, lsof /mnt or fuser -m /mnt will list the processes that have open files in /mnt. To force the unmounting of a busy file system, one can use the -l option of the umount command, which will perform a lazy unmount. This means that the file system will be detached as soon as it is not busy anymore3. References: 1: How to solve "device is busy" problem in Linux 2: How to Find Out Which Process Is Using a File in Linux 3: umount(8) - Linux man page
NEW QUESTION # 53
What are the main differences between GPT and MBR partition tables regarding maximum number and size of partitions? (Choose two.)
- A. MBR can handle partition sizes up to 2.2 TB, whereas GPT supports sizes up to 9.4 ZB.
- B. MBR can handle partition sizes up to 4 TB, whereas GPT supports partition sizes up to 128 ZB.
- C. By default, GPT can manage up to 64 partitions while MBR only supports 16 primary partitions.
- D. By default, GPT can manage up to 128 partitions while MBR only supports four primary partitions.
- E. Both GPT and MBR support up to four primary partitions, each with up to 4096 TB.
Answer: A,D
NEW QUESTION # 54
Running chmod 640 filea.txtas a regular user doesn't update filea.txt's permission. What might be a reason why chmod cannot modify the permissions? (Choose two.)
- A. filea.txthas the SetUID bit set which imposes the restriction that only the rootuser can make changes to the file.
- B. filea.txthas the sticky bit set and a regular user cannot remove this permission.
- C. filea.txtis a hard link whose permissions are inherited from the target and cannot be set directly.
- D. filea.txtis a symbolic link whose permissions are a fixed value which cannot be charged.
- E. filea.txtis owned by another user and a regular user cannot change the permissions of another user's file.
Answer: D,E
NEW QUESTION # 55
Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose TWO correct answers.)
- A. ctrl XX
- B. esc :wq!
- C. ctrl :w!
- D. esc ZZ
- E. esc zz
Answer: B,D
NEW QUESTION # 56
Which of the following commands lists all currently installed packages when using RPM package management?
yum --query --all
- A. rpm --query --all
- B. rpm --query --list
- C.
- D. yum --list --installed
- E. rpm --list --installed
Answer: C
NEW QUESTION # 57
While editing a file in vi, the file changes due to another process. Without exiting vi, how can the file be reopened for editing with the new content?
- A. :n
- B. :w
- C. :e
- D. :r
Answer: C
Explanation:
Explanation
The :e command in vi is used to edit a file. If the file name is not specified, it will edit the current file. If the file has been changed by another process, the :e command will reload the file with the new content, discarding any unsaved changes made in vi. Therefore, the :e command can be used to reopen the file for editing with the new content without exiting vi. The other options are either invalid or do not perform the desired task.
The :r command is used to read the content of another file or command and insert it into the current file.
The :n command is used to edit the next file in the argument list, if any. The :w command is used to write the current file to disk, optionally with a new name. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.7 Use and edit text files
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
NEW QUESTION # 58
Which of the following properties of a Linux system should be changed when a virtual machine is cloned?
(Choose two.)
- A. The partitioning scheme
- B. The D-Bus Machine ID
- C. The SSH host keys
- D. The permissions of /root/
- E. The file system
Answer: B,C
NEW QUESTION # 59
Which of the following statements are correct when comparing Linux containers with traditional virtual machines (e.g. LXC vs. KVM)? (Choose three.)
- A. Containers on the same host can use different operating systems, as the container hypervisor creates separate kernel execution.
- B. The guest environment for fully virtualized machines is created by a hypervisor which provides virtual and emulated hardware devices.
- C. Fully virtualized machines can run any operating system for a specific hardware architecture within the virtual machine.
- D. Containers are a lightweight virtualization method where the kernel controls process isolation and resource management.
- E. Containers are completely decoupled from the host system's physical hardware and can only use emulated virtual hardware devices.
Answer: B,C,D
Explanation:
Explanation
NEW QUESTION # 60
What is the purpose of the xargscommand?
- A. It asks a question, graphically, and returns the answer to the shell.
- B. It repeats the execution of a command using different parameters for each invocation.
- C. It allows specifying long options (like --help) for commands that normally only accept short options (like - h)
- D. It passes arguments to an X server.
- E. It reads standard input and builds up commands to execute.
Answer: E
NEW QUESTION # 61
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 -f c.txt a.txt
- B. ln a.txt c.txt
- C. ln c.txt a.txt
- D. ln -h a.txt c.txt
- E. ln -i 525385 c.txt
Answer: B
Explanation:
Explanation
This command creates a hard link to a.txt with the name c.txt. The new file c.txt will have the same inode number as a.txt (Inode 525385).
A hard link is a directory entry that points to the same data blocks as another file. A hard link is indistinguishable from the original file, and it shares the same inode number, permissions, ownership, and timestamps. A hard link can only be created within the same file system, and it cannot link to directories or special files. A hard link increases the link count of the file, which is the number of directory entries that refer to the file. The link count can be seen by using the ls -l command. The file is only deleted when the link count reaches zero, which means that all the hard links to the file are removed.
The ln command is used to create hard links or symbolic links. The syntax of the ln command is:
ln [options] source target
The source is the name of the existing file, and the target is the name of the new link. By default, the ln command creates a hard link, unless the -s option is used to create a symbolic link. A symbolic link is a special file that contains the path to another file or directory. A symbolic link is different from a hard link, as ithas its own inode number, permissions, ownership, and timestamps. A symbolic link can link to any file or directory, even across file systems, and it does not affect the link count of the file. A symbolic link can be identified by the ls -l command, as it shows the link name followed by an arrow and the target name.
For example, to create a hard link to a.txt with the name c.txt, use the following command:
ln a.txt c.txt
This command will create a new file c.txt that has the same inode number as a.txt (Inode 525385). The output of the ls -i command will show something like:
525385 a.txt 525385 c.txt
To create a symbolic link to a.txt with the name b.txt, use the following command:
ln -s a.txt b.txt
This command will create a new file b.txt that has a different inode number than a.txt (Inode 526053), and contains the path to a.txt. The output of the ls -i command will show something like:
525385 a.txt 526053 b.txt -> a.txt
References:
* Linux Hard and Soft Links - Linuxize
* ln(1) - Linux manual page
* How to Create Hard and Symbolic Links in Linux - How-To Geek
NEW QUESTION # 62
Which signal is sent by the kill command by default?
- A. SIGTERM(15)
- B. SIGKILL(9)
- C. SIGQUIT(3)
- D. SIGHUP(1)
Answer: A
NEW QUESTION # 63
Which of the following files exist in a standard GRUB 2 installation? (Choose two.)
- A. /boot/grub/fstab
- B. /boot/grub/linux/vmlinuz
- C. /boot/grub/grub.cfg
- D. /boot/grub/i386-pc/1vm.mod
- E. /boot/grub/stages/stage0
Answer: C,D
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 # 64
After modifying GNU GRUB's configuration file, which command must be run for the changes to take effect?
- A. kill -HUP $(pidof grub)
- B. No action is required
- C. grub-install
- D. grub
Answer: C
Explanation:
Explanation
After modifying GNU GRUB's configuration file, which is usually located at /etc/default/grub, the command that must be run for the changes to take effect is grub-install12. The grub-install command is used to install GRUB on a device or partition, and to update the boot sector and the core image of GRUB3. The command takes the following basic syntax:
$ grub-install [options] install_device
The install_device argument specifies the device or partition where GRUB should be installed, such as
/dev/sda or /dev/sda1. The options can be used to control various aspects of the installation, such as the target platform, the boot directory, the force mode, the verbosity level, etc3.
The grub-install command also invokes the grub-mkconfig command, which generates the GRUB configuration file (usually located at /boot/grub/grub.cfg) based on the settings in /etc/default/grub and the scripts in /etc/grub.d4. The grub-mkconfig command can also be run separately to update the GRUB configuration file without reinstalling GRUB on the device or partition4.
The other options in the question are not correct because:
* A. kill -HUP $(pidof grub): This command would send the hangup signal (HUP) to the process ID (PID) of grub, which is a command-line interface for GRUB. This would not update the GRUB configuration file or install GRUB on the device or partition.
* C. grub: This command would run the command-line interface for GRUB, which allows the user to interact with GRUB and execute various commands. This would not update the GRUB configuration file or install GRUB on the device or partition, unless the user explicitly runs the appropriate commands within the interface.
* D. No action is required: This option is false, because modifying the /etc/default/grub file alone does not affect the GRUB configuration file or the GRUB installation. The user needs to run either grub-install or grub-mkconfig to apply the changes.
References:
1: How to Update Grub on Ubuntu and Other Linux Distributions - It's FOSS 2: How to Configure the GRUB2 Boot Loader's Settings 3: Ubuntu Manpage: grub-install - install GRUB on a device 4: [GNU GRUB Manual 2.06: Invoking grub-mkconfig] : [GNU GRUB Manual 2.06: Invoking grub] : [kill(1) - Linux manual page] : [pidof(8) - Linux manual page] : [grub(8) - Linux manual page]
NEW QUESTION # 65
......
The LPIC-1 Exam 101, Part 1 of 2, version 5.0 is a valuable certification for anyone who is interested in Linux administration. It is an entry-level certification that provides a solid foundation in Linux administration, making it an ideal starting point for those who are new to the field. Additionally, the certification is globally recognized, which means that it is a valuable asset for anyone who wants to work in the Linux industry.
Pass Your Next 101-500 Certification Exam Easily & Hassle Free: https://examtorrent.testkingpdf.com/101-500-testking-pdf-torrent.html

