
合格させる試験完全版101-500問題集299解答
検証済み101-500問題集と解答100%合格はここ
質問 # 156
Upon booting one of your Linux boxes, you notice a message scrolling by that does not look right, but it goes so fast, you do not have a chance to read it. What command could you use to view that message after the boot process completes?
正解:
解説:
dmesg
質問 # 157
Which run levels should never be declared as the default run level when using SysV init? (Choose TWO correct answers.)
- A. 0
- B. 1
- C. 2
- D. 3
- E. 4
正解:B、C
解説:
Explanation
Run levels are predefined modes of operation in the SysV init system that determine which processes and services are started or stopped. The default run level is the one that the system enters after booting. It is usually specified in the /etc/inittab file with a line like id:5:initdefault:. The run levels 0 and 6 should never be declared as the default run level because they are used to halt and reboot the system, respectively. If they are set as the default, the system will enter an endless loop of shutting down and restarting. The other run levels (1-5) have different meanings depending on the distribution, but they usually correspond to single-user mode, multi-user mode, network mode, graphical mode, etc. References: LPI Linux Essentials - 1.101.2, LPI Linux Administrator - 101.3
質問 # 158
What is the effect of the egrep command when the -v option is used?
- A. It shows the command's version information.
- B. It changes the output order showing the last matching line first.
- C. It only outputs non-matching lines.
- D. It enables color to highlight matching parts.
正解:C
解説:
Explanation
The -v option for the egrep command activates the invert matching mode, which means that it only outputs the lines that do not match the given pattern or regular expression. This is useful for filtering out unwanted lines or finding exceptions in a file. For example, the following command will output all the lines in the file my_text that do not contain the word "Linux":
egrep -v Linux my_text
The -v option can be combined with other options to modify the output format or behavior of the egrep command. For example, the -c option will count the number of non-matching lines instead of printing them, and the -i option will ignore the case of the pattern while matching. References:
* [LPI Exam 101 Detailed Objectives], Topic 103: GNU and Unix Commands, Objective 103.7: Perform basic file management, Weight: 4, Key Knowledge Areas: Use of egrep to search for extended regular expressions in text output.
* [Linux egrep Command with Examples], Topic: Invert Matching with egrep.
質問 # 159
Which umask value ensures that new directories can be read, written and listed by their owning user, read and listed by their owning group and are not accessible at all for everyone else?
- A. 0029
- B. 0
- C. 0750
- D. 0027
- E. 0036
正解:D
解説:
The umask value is a four-digit octal number that determines the default permissions for new files and directories created by a user. The umask value specifies the permissions that are not granted to the user, group, and others. The permissions are represented by three bits for each category, where 1 means execute, 2 means write, and 4 means read. The sum of these values indicates the combination of permissions. For example, 7 means read, write, and execute; 6 means read and write; 5 means read and execute; 4 means read only; 3 means write and execute; 2 means write only; 1 means execute only; and 0 means no permission.
The umask value is subtracted from the maximum permissions for files and directories, which are 666 and
777, respectively. The maximum permissions are then converted to binary and bitwise ANDed with the bitwise complement of the umask value. The result is the default permissions for the new files and directories.
For example, if the umask value is 0027, the default permissions for a new file are:
666 - 027 = 639 639 in octal = 110 011 001 in binary 027 in octal = 000 010 111 in binary Bitwise complement of 027 = 111 101 000 in binary 110 011 001 AND 111 101 000 = 110 001 000 in binary 110 001
000 in binary = 608 in octal 608 in octal = rw- - -
The default permissions for a new directory are:
777 - 027 = 750 750 in octal = 111 101 000 in binary 027 in octal = 000 010 111 in binary Bitwise complement of 027 = 111 101 000 in binary 111 101 000 AND 111 101 000 = 111 101 000 in binary 111 101
000 in binary = 750 in octal 750 in octal = rwx r-x -
Therefore, the umask value of 0027 ensures that new files can be read and written by their owning user, and are not accessible at all for everyone else. New directories can be read, written and listed by their owning user, read and listed by their owning group, and are not accessible at all for everyone else.
References:
Umask command in Linux with examples - GeeksforGeeks
What Is umask in Linux, and How Do You Use It? - How-To Geek
What is UMASK and how to set UMASK in Linux/Unix? - Kernel Talks
質問 # 160
Which of the following commands is used to change options and positional parameters within a running Bash shell?
history
- A. setsh
- B.
- C. bashconf
- D. envsetup
- E. set
正解:D
質問 # 161
Which of the following pieces of information of an existing file is changed when a hard link pointing to that file is created?
- A. File size
- B. Modify timestamp
- C. Permissions
- D. Inode number
- E. Link count
正解:E
解説:
When a hard link pointing to a file is created, the link count of the file is increased by one. The link count is the number of hard links that refer to the same inode. The file size, modify timestamp, inode number and permissions are not affected by creating a hard link. References:
* LPI Exam 101 Detailed Objectives, Topic 104: Devices, Linux Filesystems, Filesystem Hierarchy Standard, Weight: 9, Objective 104.5: Create and change hard and symbolic links
* LPI Linux Essentials Study Guide, Chapter 4: The Linux Filesystem, Section 4.3: Hard and Symbolic Links, Page 81
質問 # 162
Which chown command will change the ownership to dave and the group to staff on a file named data.txt?
- A. chown dave:staff data.txt
- B. chown --user dave --group staff data.txt
- C. chown dave/staff data.txt
- D. chown -u dave -g staff data.txt
正解:A
解説:
The chown command is used to change the owner and group of files and directories in Linux. The basic syntax of the chown command is:
chown [options] user[:group] file...
The user is the name or the numeric ID of the new owner of the file. The group is the name or the numeric ID of the new group of the file. The file is the name or the path of the file or directory to be changed. The user and group are separated by a colon (:), not a slash (/). The group is optional, and if it is omitted, the group will not be changed. The options are optional, and they can modify the behavior of the chown command, such as changing the ownership recursively, silently, or verbosely.
In this question, the user is dave and the group is staff. The file is data.txt. Therefore, the correct command to change the ownership to dave and the group to staff on data.txt is:
chown dave:staff data.txt
This command will change the owner of data.txt to dave and the group of data.txt to staff. You can verify the changes by using the ls -l command to view the owner and group of data.txt.
The other options are not correct because:
* A. chown dave/staff data.txt: This command is not valid because it uses a slash (/) instead of a colon (:) to separate the user and group. The slash (/) is used to separate the directories in a path, not the user and group in the chown command. If you run this command, you will get an error message saying:
chown: invalid user: 'dave/staff'
* B. chown -u dave -g staff data.txt: This command is not valid because it uses the -u and -g options, which do not exist in the chown command. The -u and -g options are used in the chgrp command, which is used to change only the group of files and directories, not the owner. The chown command does not have the -u and -g options, and it uses the user[:group] argument to specify the new owner and group. If you run this command, you will get an error message saying:
chown: invalid option - 'u' Try 'chown --help' for more information.
* C. chown --user dave --group staff data.txt: This command is not valid because it uses the --user and -- group options, which do not exist in the chown command. The --user and --group options are used in the usermod command, which is used to modify the user account information, not the file ownership.
The chown command does not have the --user and --group options, and it uses the user[:group] argument to specify the new owner and group. If you run this command, you will get an error message saying:
chown: unrecognized option '-user' Try 'chown --help' for more information.
References:
Chown Command in Linux: How to Change File Ownership - phoenixNAP
chown command in Linux with Examples - GeeksforGeeks
How to Use the chown Command on Linux - How-To Geek
質問 # 163
How many fields are in a syntactically correct line of /etc/fstab?
- A. 0
- B. 1
- C. 2
- D. 3
- E. 4
正解:C
質問 # 164
Which of the following tools can show the complete path of an executable file that the current shell would execute when starting a command without specifying its complete path? (Choose two.)
- A. find
- B. pwd
- C. locate
- D. which
- E. type
正解:D、E
質問 # 165
In the vi editor, which of the following commands will copy the current line into the vi buffer?
- A. 1y
- B. 1c
- C. cc
- D. c
- E. yy
正解:E
解説:
Explanation
The command that will copy the current line into the vi buffer is yy. The yy command is a shorthand for yank yank, which means to yank (copy) the current line. The vi buffer is a temporary storage area where thecopied text is stored until it is pasted somewhere else. The yy command can also be preceded by a number to indicate how many lines to copy. For example, the command 3yy will copy the current line and the next two lines into the buffer.
The other commands are incorrect for the following reasons:
* A. c: This command is a shorthand for change, which means to delete the text specified by the following motion and enter insert mode. For example, the command cw will delete the current word and allow the user to type a new one.
* B. cc: This command is a shorthand for change change, which means to delete the current line and enter insert mode. This command is similar to dd followed by i, but it is faster and more convenient.
* C. 1c: This command is not valid, as it is missing a motion after the change command. The motion specifies what text to delete and replace. For example, the command 1cw will delete one word and enter insert mode.
* E. 1y: This command is also not valid, as it is missing a motion after the yank command. The motion specifies what text to copy into the buffer. For example, the command 1yw will copy one word into the buffer.
References:
* [LPI Exam 101 Detailed Objectives], Topic 103: GNU and Unix Commands, Objective 103.8: Perform basic file editing operations using vi, Weight: 3, Key Knowledge Areas: Navigate a document using vi.
* Vi Cheat Sheet, Topic: Basic vi commands.
質問 # 166
In the vi editor, what vi command will copy (but not paste) from the current line at the cursor and the following 16 lines (17 lines total)?
Specify the correct vi command without spaces.
正解:
解説:
17yy
質問 # 167
Which of the following commands will change the quota for a specific user?
- A. edquota
- B. quota
- C. quota -e
- D. repquota
正解:A
解説:
Explanation
The correct command to change the quota for a specific user is edquota. This command allows you to edit the quota limits for a user, a group, or a file set. You can specify the name of the user that you want to edit the quotas for after the command. For example, to change the disk quota for user 'linuxconfig', you can use the following command:
sudo edquota -u linuxconfig
This command will open an editor with the current quota information for the user 'linuxconfig'. You can modify the soft and hard limits for the block and inode usage as per your requirements. You can also use the -p option to copy the quota settings from another user. For example, to copy the quota settings from user
'ramesh' to user 'linuxconfig', you can use the following command:
sudo edquota -p ramesh -u linuxconfig
The other commands are not suitable for changing the quota for a specific user. The repquota command displays a summary of the current quota usage and limits for the users or groups. The quota -e command turns off the disk quota for the current user. The quota command shows the disk quota and usage for the current user or for the users specified on the command line. For more information on how to use disk quota on Linux, you can refer to the following articles:
* How to use disk quota on Linux with examples
* 5 Steps to Setup User and Group Disk Quota on UNIX / Linux
質問 # 168
The command dbmaint & was used to run dbmaint in the background. However, dbmaint is terminated after logging out of the system. Which alternative dbmaint invocation lets dbmaint continue to run even when the user running the program logs out?
- A. job -b dmaint
- B. bg dbmaint
- C. dbmaint &>/dev/pts/null
- D. wait dbmaint
- E. nohup dbmaint &
正解:E
解説:
This command will run dbmaint in the background and make it immune to hangup signals, which means it will continue to run even when the user logs out of the system. The nohup command prefixes the command with nohup, which intercepts the SIGHUP signal that is sent to the process when the terminal session ends.
The output of the command is redirected to a file called nohup.out by default, unless specified otherwise. The
& symbol puts the command in the background, allowing the user to run other commands in the same shell.
The other commands are incorrect for the following reasons:
* A, job -b dbmaint: This command is invalid and will not work. There is no job command in Linux, and the -b option is not a valid option for any command. The command that is used to list the background jobs in the current shell session is jobs, and it does not have a -b option either.
* B, dbmaint &>/dev/pts/null: This command will run dbmaint in the background, but it will not prevent it from being terminated when the user logs out of the system. The &> symbol redirects both the standard output and standard error of the command to a file or device, in this case /dev/pts/null.
However, this device does not exist, and the redirection will fail. Even if the device was /dev/null, which is a special device that discards any output sent to it, the command would still be susceptible to hangup signals and would not survive the logout.
* D, bg dbmaint: This command will not run dbmaint in the background, but it will try to resume a stopped background job with the name dbmaint. The bg command is used to move a stopped foreground process to the background and continue its execution. However, if there is no such process with the name dbmaint, the command will fail. Even if there was such a process, it would still be terminated when the user logs out of the system, unless it was disowned or prefixed with nohup.
* E, wait dbmaint: This command will not run dbmaint in the background, but it will wait for a background process with the name dbmaint to finish and return its exit status. The wait command is used to pause the execution of the current shell until one or more background processes complete.
However, if there is no such process with the name dbmaint, the command will fail. Even if there was such a process, it would still be terminated when the user logs out of the system, unless it was disowned or prefixed with nohup.
:
How to Run Linux Commands in Background | Linuxize
How to Run Linux Commands in Background | phoenixNAP KB
How to Run Linux Commands in the Background - MUO
How to Run Linux Commands in Background & Bring Them Back
質問 # 169
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 init=/bin/sh on the kernel parameter line.
- B. Pass start=/bin/sh on the kernel parameter line.
- C. Pass /bin/sh on the kernel parameter line.
- D. Start in runlevel 1.
正解:A
解説:
The usual way to pass this change to the kernel from the boot loader is to pass init=/bin/sh on the kernel parameter line12. The init kernel parameter is used to specify the program that is run as the first process after the kernel is loaded3. By default, this program is /sbin/init, which is responsible for starting and managing other processes and services4. However, by passing init=/bin/sh, the kernel will run /bin/sh instead, which is a shell program that allows the user to execute commands interactively or from a script5. This way, the user can bypass the usual initialization process and run /bin/sh as the root user, which can be useful for troubleshooting or recovery purposes12.
The other options in the question are not correct because:
* A. Start in runlevel 1: This option would not bypass the /sbin/init program, but rather instruct it to start the system in single-user mode, which is a mode that allows only the root user to log in, and disables all network services and graphical interfaces. To start in runlevel 1, the user would need to pass single or 1 on the kernel parameter line, not init=/bin/sh.
* C. Pass /bin/sh on the kernel parameter line: This option would not work, because the kernel would not recognize /bin/sh as a valid parameter and would ignore it. The kernel only accepts parameters that have a specific format, such as name=value or name.flag3. To specify the init program, the user would need to use the init= prefix, as in init=/bin/sh3.
* D. Pass start=/bin/sh on the kernel parameter line: This option would also not work, because the kernel does not have a start parameter. The user would need to use the init parameter, as in init=/bin/sh3.
:
1: How to pass arguments to a Linux kernel init= bootparam? - Unix & Linux Stack Exchange 2: kernel parameter init=/bin/bash not working? (RHEL7, RHCSA test) - Unix & Linux Stack Exchange 3: The kernel' s command-line parameters - The Linux Kernel documentation 4: [init - Wikipedia] 5: [sh - Wikipedia] :
[Single-user mode - Wikipedia] : How to Change Runlevels (targets) in SystemD - Tecmint
質問 # 170
When removing a package on a system using dpkg package management, which dpkgoption ensures configuration files are removed as well?
- A. --declare
- B. --purge
- C. --clean
- D. --vacuum
- E. --remove
正解:B
解説:
Explanation/Reference:
質問 # 171
You are formatting a single hard disk for a Linux install. What is the maximum number of primary partitions you can create?
正解:
解説:
four
質問 # 172
Which of the following commands sets the SetUID permission on the executable /bin/foo?
chmod 4755 /bin/foo
- A. chmod 1755 /bin/foo
- B.
- C. chmod 2755 /bin/foo
- D. chmod 755+s /bin/foo
- E. chmod u-s /bin/foo
正解:A
質問 # 173
What does the command mount -a do?
- A. It mounts all user mountable filesystems for the current user.
- B. It mounts all filesystems listed in /etc/fstab which have the option noauto set.
- C. It mounts all filesystems listed in /etc/fstab which have the option auto set.
- D. It mounts all available filesystems onto the current directory.
- E. It shows all mounted filesystems.
正解:C
解説:
The command mount -a mounts all filesystems that are listed in the file /etc/fstab and have the option auto set.
The option auto means that the filesystem can be mounted automatically by the mount -a command or at boot time. The option noauto means that the filesystem can only be mounted explicitly by the mount command with the device or mount point specified12. The file /etc/fstab contains information about the filesystems that are known to the system and how they can be mounted3. The command mount -a is useful for mounting all the filesystems that are needed by the system after a change in /etc/fstab or after a reboot4. References: 1:
mount(8) - Linux man page 2: Linux mount and umount commands help and examples 3: fstab(5) - Linux man page 4: How to Use the mount Command on Linux
質問 # 174
Which of the following explanations are valid reasons to run a command in the background of your shell?
- A. The command does not need to execute immediately.
- B. The command has to run immediately but the user needs to log out.
- C. The command can run at a lower priority than normal commands run on the command line.
- D. The system is being shut down and the command needs to restart execution immediately after the reboot.
正解:B
質問 # 175
Which of the following commands can be used to determine how long the system has been running? (Choose TWO correct answers.)
- A. up
- B. time -up
- C. uname -u
- D. uptime
- E. top
正解:D、E
解説:
Explanation
The uptime and top commands can be used to determine how long the system has been running.
The uptime command displays the current time, the system load, the number of users logged in, and the time since the system was last booted. The top command displays information about the processes running on the system, as well as the system load, the number of users logged in, and the time since the system was last booted. The other options are either invalid or do not perform the desired task. The up command is not a valid Linux command. The uname -u command displays the user ID of the current user, not the system uptime.
The time -up command is not a valid syntax for the time command, which measures the execution time of a command, not the system uptime. References:
* LPIC-1 Exam 101 Objectives, Topic 103: GNU and Unix Commands, 103.2 Process management
* LPIC-1 Linux Administrator 101-500 Exam FAQ, LPIC-1 Exam 101 Objectives, GNU and Unix Commands (Total Weight: 25)
質問 # 176
Which of the following is true when hard-linked files are present?
- A. The file permissions will be prefixed by an "h", eg. hrwxr-x-r-x
- B. Issuing a longdirectory listing with ls -1 will indicate the link with "->"
- C. The output of stat will report "hard" instead of "regular file"
- D. Both files will share the same inode
- E. The hard-linked files may not be empty
正解:D
質問 # 177
In bash, inserting 2>&1 after a command redirects
- A. standard output to standard error.
- B. standard input to standard error.
- C. standard error to standard output.
- D. standard output to standard input.
- E. standard error to standard input.
正解:C
質問 # 178
Which SysV init configuration file is commonly used to set the default run level?
(Specify the full name of the file, including path.)
正解:
解説:
inittab
質問 # 179
Which of the following apt-get commands will install the newest versions of all currently installed packages?
- A. auto-update
- B. dist-upgrade
- C. install
- D. full-upgrade
- E. update
正解:D
解説:
The apt-get command is used to interact with the APT package management system on Debian-based Linux distributions. The apt-get command has several subcommands that perform different operations on packages.
One of these subcommands is full-upgrade, which is used to install the newest versions of all currently installed packages, along with their dependencies. The full-upgrade command also removes any packages that are no longer needed or that conflict with the upgraded packages. The full-upgrade command is equivalent to the dist-upgrade command, which is an older name for the same operation. The other options are not valid subcommands of apt-get. The auto-update option does not exist, the install option is used to install specific packages, not to upgrade them, the update option is used to update the list of available packages, not to install them, and the dist-upgrade option is the same as the full-upgrade option. References:
* APT-GET Command in Linux {Detailed Tutorial With Examples} - phoenixNAP
* Using apt-get Commands in Linux [Ultimate Guide] - It's FOSS
* Ubuntu 'apt-get' list of commands (list, update, upgrade, cheatsheet ...
質問 # 180
Which of the following describes the correct order in which the components of the system boot process are started?
- A. BIOS, bootloader, init system, kernel
- B. BIOS, kernel, bootloader, init system
- C. Bootloader, BIOS, init system, kernel
- D. Bootloader, BIOS, kernel, init system
- E. BIOS, bootloader,kernel, init system
正解:E
解説:
The system boot process is the sequence of steps that the system follows when it is powered on or restarted.
The system boot process can be divided into four main components: BIOS, bootloader, kernel, and init system. The order in which these components are started is:
* BIOS: BIOS stands for Basic Input/Output System, and it is the first component that runs when the system is powered on. BIOS is a firmware program that is stored in a ROM chip on the motherboard, and it performs some basic tasks, such as:
* initializing the hardware components and peripherals
* performing the power-on self-test (POST) to check the system integrity
* selecting a boot device from the boot order list
* loading and executing the bootloader program from the boot device
* Bootloader: Bootloader is a small program that is responsible for loading and executing the kernel.
Bootloader is usually stored in the first sector of the boot device, which can be a hard disk, a USB drive, or a CD-ROM. Bootloader can also display a menu that allows the user to choose from different kernel images or operating systems. Some common bootloaders for Linux systems are GRUB, LILO, and SYSLINUX.
* Kernel: Kernel is the core of the operating system, and it manages the system resources, controls the hardware devices, and provides basic services to other programs. Kernel is a large binary file that is compressed and stored in the boot device, usually in the /boot directory. Kernel is loaded into memory and executed by the bootloader, and it performs some tasks, such as:
* decompressing itself and relocating to a higher memory address
* detecting and initializing the hardware devices and drivers
* mounting the root filesystem and creating a temporary filesystem in RAM
* starting the init system, which is the first user-space program
* Init system: Init system is the program that initializes the user-space environment and spawns all other processes. Init system is always the first process that runs on the system, and it has the process ID (PID) of 1. Init system can also perform some tasks, such as:
* reading the configuration files and scripts that define the system services and runlevels
* starting and stopping the system services and daemons
* managing the system logins and terminals
* running a graphical user interface or a command-line interface
Some common init systems for Linux systems are SysVinit, systemd, and Upstart.
References:
Guide to the Boot Process of a Linux System - Baeldung
The Linux Booting Process - 6 Steps Described in Detail - freeCodeCamp.org Boot Process with Systemd in Linux - GeeksforGeeks Linux Boot Process Step-by-Step Explained - javatpoint
質問 # 181
......
101-500問題集完全版解答で試験学習ガイド:https://www.passtest.jp/Lpi/101-500-shiken.html
100%101-500試験一発合格保証2025問題集:https://drive.google.com/open?id=1X9ZrmQVMX_xybjMLlsXjnlKjzNRSOU-q