101-500 Exam - Free Actual Q&As, Page 1 - ExamTopics
101-500 Exam - Free Actual Q&As, Page 1 - ExamTopics
Study Guide
$19.99
Buy Now
Video Course
125 Lectures
$19.99
Buy Now
Question #1 Topic 1
Which type of file system is created by mkfs when it is executed with the block device name only and without any additional parameters?
A. XFS
B. VFAT
C. ext2
D. ext3
E. ext4
Correct Answer: C
C, ext2
upvoted 1 times
Selected Answer: C
Selected Answer: C
Answer is C
upvoted 1 times
Selected Answer: C
Is correct
upvoted 1 times
If you don't specify the filesystem type for the target device, it will use the default ext2 filesystem.
Source: https://linuxhandbook.com/mkfs-command/
upvoted 4 times
Question #2 Topic 1
Which umask value ensures that new directories can be read, written and listed by their owning user, read and listed by their owning group
A. 0750
B. 0027
C. 0036
D. 7640
E. 0029
Correct Answer: B
B is the answer
upvoted 1 times
Selected Answer: B
I say B
upvoted 1 times
Selected Answer: B
B. 0027
upvoted 1 times
Selected Answer: B
IS correct
upvoted 1 times
Question #3 Topic 1
Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem
Correct Answer: B
it is repeated
upvoted 8 times
Question #4 Topic 1
Which is the default percentage of reserved space for the root user on new ext4 filesystems?
A. 10%
B. 3%
C. 15%
D. 0%
E. 5%
Correct Answer: E
Selected Answer: E
is correct
upvoted 1 times
Question #5 Topic 1
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. systemd ignores any manual mounts which are not done using the systemctl mount command
B. The command systemctl mountsync can be used to create a mount unit based on the existing mount
C. systemd automatically generates a mount unit and monitors the mount point without changing it
D. Unless a systemd mount unit is created, systemd unmounts the file system after a short period of time
E. systemctl unmount must be used to remove the mount because system opens a file descriptor on the mount point
Correct Answer: C
Selected Answer: C
D. Unless a systemd mount unit is created, systemd unmounts the file system after a short period of time.
This statement is not accurate. systemd doesn't automatically unmount a file system just because a systemd mount unit is not created. When a
file system is mounted manually, systemd does not have a specific timeout for unmounting it. The file system will remain mounted until explicitly
unmounted using the umount command or a similar method.
Therefore, option D is not a behavior associated with systemd when a file system is mounted manually. The more accurate representation is
option C, where systemd automatically generates a mount unit and monitors the mount point without actively unmounting it.
upvoted 1 times
Selected Answer: C
C. systemd automatically generates a mount unit and monitors the mount point without changing it
Lorsqu'un système de fichiers est monté manuellement (sans être défini dans /etc/fstab et sans utiliser une unité de montage systemd
spécifique), systemd génère automatiquement une unité de montage temporaire pour suivre ce point de montage. Il ne modifie pas le point de
montage, mais il le surveille, ce qui permet au reste du système de réagir en conséquence si nécessaire. Les autres options énumérées ne
décrivent pas correctement le comportement standard de systemd avec les montages manuels.
upvoted 1 times
B. The command systemctl mountsync can be used to create a mount unit based on the existing mount
upvoted 1 times
This had done my head and can see from others comments too...i was gunned for C but after reading the LPIC guide page 486-502 there was
nothing to support answer C and it was clear that systemd doe NOT automatically create mount points system unit i.e. mount unit needs be
created frst and auto-mount unit only then systemd manages the mount point automatically and hence C is NOT the answer..from the discussion
in the link iam providing it seems to be D which i though from the first place i.e. i was 50-50 between C and D but now im sure it is D and if
comes in exam i will gun for D, read all discussion in the link and you will see this comment quite often from varies users in different situations
upvoted 3 times
I'm experiencing more diffulties with 'mount' failing silently. Below is a transcript of two examples of this. In the first case, it seems from
'journalctl' that the kernel is mounting the device, but Systemd is (silently, to the user) unmounting it. Unlike with my original example,
systemctl daemon-reload does not fix the problem.
https://github.com/systemd/systemd/issues/1741
Feel free to comments further but please back it up with facts!!
upvoted 1 times
For me is C
upvoted 3 times
C. "systemd automatically generates a mount unit and monitors the mount" yes, but it also says "without changing it", and when a mount point is
mounted manually without list it on /etc/fstab the mount unit will be unmounted every boot time, or even, on each period of time
D. If you don't announce the mount pint in /etc/fstab, the only way to have a correct mount point is by creating it with the systems mount
(https://oguya.ch/posts/2015-09-01-systemd-mount-partition/). Finally we can set a cron that start the mount unit every boot time, which, it can
not be possible whit the option C without creating an entry on the /etc/fstab file.
E. And finally the "E" answer all we know doesn't make sense.
upvoted 3 times
Selected Answer: C
According to systemd.mount man page: "Mount points created at runtime (independently of unit files or /etc/fstab) will be monitored by
systemd and appear like any other mount unit in systemd."
upvoted 5 times
Question #6 Topic 1
FILL BLANK -
Which program updates the database that is used by the locate command? (Specify ONLY the command without any path or parameters).
Question #7 Topic 1
D. It mounts all file systems listed in /etc/fstab which have the option userbind set
Correct Answer: A
Selected Answer: A
The answer is A
upvoted 1 times
Question #8 Topic 1
How would a new file named c.txt be created with the same inode number as a.txt (Inode 525385)?
A. ln -h a.txt c.txt
B. ln c.txt a.txt
C. ln a.txt c.txt
D. ln -f c.txt a.txt
E. ln -i 525385 c.txt
Correct Answer: C
Selected Answer: A
Question #9 Topic 1
Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)
Correct Answer: AE
A and E is correct.
upvoted 6 times
Selected Answer: AC
The correct answers are A. chmod g+s sales and C. chgrp -p sales sales.
The chmod g+s command sets the group-set-ID bit for the directory sales. This means that new files created within the directory sales will inherit
the group ownership of the directory, which is sales.
The chgrp -p command changes the group ownership of the directory sales and all of its files and subdirectories recursively. This means that all
files currently in the directory sales and all new files created within the directory will be owned by the group sales.
In order to display all currently mounted filesystems, which of the following commands could be used? (Choose two.)
A. cat /proc/self/mounts
B. free
C. lsmounts
D. mount
E. cat /proc/filesystems
Correct Answer: AD
The /proc/self/mounts file contains information about all of the filesystems that are currently mounted on the system. This file is a text file that
can be read using the cat command.
Option D: mount
The mount command can be used to list all of the filesystems that are currently mounted on the system. The mount command without any
arguments will display a list of all currently mounted filesystems.
FILL BLANK -
Which command displays the current disk space usage for all mounted file systems? (Specify ONLY the command without any path or
parameters.)
Correct Answer: df
The df command displays information about the disk space usage for all currently mounted file systems. It does not require any path or
parameters.
du command – Display the amount of disk space used by the specified files and for each subdirectory.
btrfs fi df /device/ – Show disk space usage information for a btrfs based mount point/file system.
upvoted 2 times
Which chown command changes the ownership to dave and the group to staff on a file named data.txt?
Correct Answer: E
Selected Answer: E
E is correct
upvoted 3 times
Selected Answer: E
correct!
upvoted 1 times
When considering the use of hard links, what are valid reasons not to use hard links?
A. Hard links are not available on all Linux systems because traditional filesystems, such as ext4, do not support them
B. Each hard link has individual ownership, permissions and ACLs which can lead to unintended disclosure of file content
C. Hard links are specific to one filesystem and cannot point to files on another filesystem
D. If users other than root should be able to create hard links, suln has to be installed and configured
E. When a hard linked file is changed, a copy of the file is created and consumes additional space
Correct Answer: C
No C is correct
upvoted 14 times
Selected Answer: C
The valid reasons not to use hard links are B. Each hard link has individual ownership, permissions, and ACLs, which can lead to unintended
disclosure of file content, and C. Hard links are specific to one filesystem and cannot point to files on another filesystem.
upvoted 1 times
Selected Answer: C
I C is correct
upvoted 1 times
Selected Answer: C
While useful, there are some limitations to what hard links can do. For starters, they can only be created for regular files (not directories or
special files). Also, a hard link cannot span multiple filesystems. They only work when the new hard link exists on the same filesystem as the
original
upvoted 2 times
In compliance with the FHS, in which of the directories are man pages found?
A. /opt/man/
B. /usr/doc/
C. /usr/share/man/
D. /var/pkg/man
E. /var/man/
Correct Answer: C
C is ok
/usr/share/man/
upvoted 12 times
Selected Answer: C
According to the Filesystem Hierarchy Standard (FHS), man pages (manual pages) should be installed under the /usr/share/man directory. This
directory is specifically designated for storing shared resources, such as man pages, documentation, fonts, and other files that are not specific to
any particular application.
upvoted 1 times
FILL BLANK -
Which file in the /proc filesystem lists parameters passed from the bootloader to the kernel? (Specify the file name only without any path.)
The /proc/cmdline file contains the command-line parameters that were passed to the kernel when the system was booted. These parameters
can include information about the boot device, kernel options, and other system-specific settings.
upvoted 1 times
What is the process ID number of the init process on a System V init based system?
A. -1
B. 0
C. 1
Correct Answer: C
In System V init-based systems, the init process is the first process to be started when the system boots. It is responsible for initializing the system
and starting other system services. The init process is assigned the process ID number 1. This means that the init process is the parent of all other
processes on the system.
upvoted 1 times
A. acpid
B. batteryd
C. pwrmgntd
D. psd
E. inetd
Correct Answer: A
Answer A.
acpid: Advanced Configuration and Power Interface
Refer: https://www.thegeekdiary.com/linux-os-service-
acpid/#:~:text=The%20acpid%20daemon%20supports%20the,programs%20to%20handle%20the%20event.
upvoted 5 times
Selected Answer: A
A is correct
upvoted 1 times
Selected Answer: A
A is correct
upvoted 1 times
CORRECT!
upvoted 1 times
Which of the following statements are true about the boot sequence of a PC using a BIOS? (Choose two.)
A. Some parts of the boot process can be configured from the BIOS
B. Linux does not require the assistance of the BIOS to boot a computer
C. The BIOS boot process starts only if secondary storage, such as the hard disk, is functional
D. The BIOS initiates the boot process after turning the computer on
E. The BIOS is started by loading hardware drivers from secondary storage, such as the hard disk
Correct Answer: AD
Why would B be incorrect? A UEFI can be used instead, so BIOS is not required.
upvoted 1 times
Selected Answer: AD
Sounds gr8t
upvoted 1 times
Correct Answer: BD
I think the correct answer is a and b, because the firmware is storage in the motherboard, not in a disk, like says "gpt metadata".
upvoted 9 times
Selected Answer: AB
UEFI firmware is responsible for initializing the hardware and loading the operating system. This includes reading and interpreting the partition
table on the boot drive. The partition table tells the firmware where the operating system is located and how it is partitioned.
Selected Answer: AB
Selected Answer: BD
https://learning.lpi.org/en/learning-materials/101-500/102/102.2/102.2_01/
GPT-partitioned disks can be used either with computers with the traditional PC BIOS or ones with UEFI firmware. On machines with a BIOS, the
second part of GRUB is stored in a special BIOS boot partition.
On systems with UEFI firmware, GRUB is loaded by the firmware from the files grubia32.efi (for 32-Bit systems) or grubx64.efi (for 64-Bit systems)
from a partition called the ESP (EFI System Partition).
upvoted 2 times
Selected Answer: AB
A and B is right.
upvoted 2 times
Selected Answer: BD
Correct stores info in EFI partition nothing to do with GPT or other devices
upvoted 3 times
Selected Answer: AB
As the BIOS, the UEFI is also a firmware, but it can identify partitions and read many filesystems found in them.
upvoted 4 times
Selected Answer: AB
The UEFI is a firmware, but it can identify partitions and read many filesystems found in them. The UEFI does not rely on the MBR, taking into
account only the settings stored in its non-volatile memory (NVRAM) attached to the motherboard.
Ref: https://learning.lpi.org/en/learning-materials/101-500/101/101.2/101.2_01/
upvoted 2 times
UEFI and the ESP is a set/special partition on the hard disk. GPT does use UEFI firmware. The efi file is stored but technically UEFI in general can
be loaded however GPT is a definite related component. A fixed boot disk partition pertains to MBR so E is out. Reading & interpreting partition
tables seems more accurate than reading the file system itself.
https://www.alphr.com/mbr-vs-gpt/#:~:text=GPT%20stands%20for,1%20(LBA%201).
https://www.freecodecamp.org/news/uefi-vs-bios/#:~:text=UEFI%20stands%20for,contains%20the%20bootloader.
https://www.happyassassin.net/posts/2014/01/25/uefi-boot-how-does-that-actually-work-
then/#:~:text=The%20GUID%20Partition,firmware%20to%20have.
upvoted 2 times
A faulty kernel module is causing issues with a network interface card. Which of the following actions ensures that this module is not loaded
A. Using lsmod --remove --autoclean without specifying the name of a specific module
D. Adding a blacklist line including the name of the offending module to the file /etc/modprobe.d/blacklist.conf
E. Deleting the kernel module's directory from the file system and recompiling the kernel, including its modules
Correct Answer: D
Correct Answer: D
https://wiki.archlinux.org/title/Kernel_module Blacklisting section.
upvoted 1 times
When is the content of the kernel ring buffer reset? (Choose two.)
A. When the ring buffer is explicitly reset using the command dmesg --clear
B. When the ring buffer is read using dmesg without any additional parameters
Correct Answer: AE
Selected Answer: AE
What is the first program the Linux kernel starts at boot time when using System V init?
A. /lib/init.so
B. /proc/sys/kernel/init
C. /etc/rc.d/rcinit
D. /sbin/init
E. /boot/init
Correct Answer: D
https://tldp.org/LDP/sag/html/init-process.html
upvoted 12 times
A Debian package creates several files during its installation. Which of the following commands searches for packages owning the file
/etc/debian_version?
B. apt -r /etc/debian_version
D. dpkg -S /etc/debian_version
E. apt-file /etc/debian_version
Correct Answer: D
and some other characters that probably has been encoded wrong that makes ("), (`) and (-) look wrong.
upvoted 10 times
Selected Answer: D
Correct Answer: B
Selected Answer: B
The EFI System Partition contains the first stage boot loader
upvoted 2 times
Which of the following directories on a 64 bit Linux system typically contain shared libraries? (Choose two.)
A. ~/.lib64/
B. /usr/lib64/
C. /var/lib64/
D. /lib64/
E. /opt/lib64/
Correct Answer: BD
Which of the following files exist in a standard GRUB 2 installation? (Choose two.)
A. /boot/grub/stages/stage0
B. /boot/grub/i386-pc/lvm.mod
C. /boot/grub/fstab
D. /boot/grub/grub.cfg
E. /boot/grub/linux/vmlinuz
Correct Answer: BD
Selected Answer: BD
is good
upvoted 1 times
Which of the following commands installs all packages with a name ending with the string foo?
Correct Answer: D
only correct answer is D as neither get, update, force nor add install anything
upvoted 3 times
Which of the following properties of a Linux system should be changed when a virtual machine is cloned? (Choose two.)
Correct Answer: CE
https://wiki.debian.org/MachineId#:~:text=The%20machine%20id%20is%20something%20that%20is%20frequently%20missed%20to%20chan
ge%20when%20cloning%20a%20machine
https://unix.stackexchange.com/questions/402999/is-it-ok-to-change-etc-machine-id
https://askubuntu.com/questions/1179897/ubuntu-18-04-guests-which-cloned-by-virtualbox-have-the-same-ip-but-different-ma
https://blog.technodrone.cloud/2013/01/the-ssh-key-problem-with-cloned-linux.html
upvoted 3 times
Selected Answer: CE
https://access.redhat.com/documentation/en-
us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/cloning_virtual_machines
upvoted 1 times
Selected Answer: CE
Machine ID is a unique hexadecimal 32 character string given to your machine during installation. So it should be changed if the machine is
cloned to prevent duplicate ID on a network.
SSH keys are unique to each server/client and also should be changed to securely SSH
upvoted 2 times
https://www.thegeekdiary.com/centos-rhel-7-how-to-change-the-machine-id/
https://w w w .examtopics.com/exams/lpi/101-500/custom-view / 33/128
11/1/24, 11:57 101-500 Exam – Free Actual Q&As, Page 1 | ExamTopics
upvoted 3 times
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_virtualization/cloning-virtual-
machines_configuring-and-managing-
virtualization#:~:text=Note%20that%20disk%20images%20for%20VMs%20created%20in%20the%20system%20connection%20of%20libvirt%
20are%20by%20default%20located%20in%20the%20/var/lib/libvirt/images%20directory%20and%20owned%20by%20the%20root%20user
upvoted 1 times
Which of the following commands installs GRUB 2 into the master boot record on the third hard disk?
B. grub-mkrescue /dev/sdc
C. grub-mbrinstall /dev/sdc
D. grub-setup /dev/sdc
E. grub-install /dev/sdc
Correct Answer: E
It's good to remember that unlike GRUB Legacy, you don't need to install GRUB2. all you do is rebuild the main installation file. This is done by
running either grub-mkconfig or grub2-mkconfig.
upvoted 8 times
To install GRUB2, the correct command is grub-install /dev/sdc. The command grub2 install /dev/sdc is not the correct syntax. The grub-install
command is used to install the GRUB bootloader to the Master Boot Record (MBR) of the specified device, in this case, /dev/sdc. (says GPT)
upvoted 1 times
https://unix.stackexchange.com/questions/183053/grub-install-command-not-found
upvoted 4 times
Which of the following partition types is used for Linux swap spaces when partitioning hard disk drives?
A. 7
B. 82
C. 83
D. 8e
E. fd
Correct Answer: B
https://www.tldp.org/HOWTO/Partition-Mass-Storage-Definitions-Naming-HOWTO/x190.html
upvoted 10 times
82 Linux Swap
83 Linux
upvoted 7 times
This is one of those trivia questions that you don't really need to know. fdisk, e.g. lists swap along with the type #
upvoted 1 times
A. Changes to the repository configuration become active after running yum confupdate
B. Changes to the yum configuration become active after restarting the yumd service
Correct Answer: CD
Correct:
https://docs.fedoraproject.org/en-US/Fedora/17/html/System_Administrators_Guide/sec-Configuring_Yum_and_Yum_Repositories.html
upvoted 5 times
E is saying that /etc/yum.conf is ignored if the directory /etc/yum.repos.d/ contains files, while your quote is saying that any settings that
you define/change in the configuration file can override values in the individual repos.
upvoted 1 times
This is true. In the typical configuration, repository information is stored in separate files under the /etc/yum.repos.d/ directory.
This is true. Yum configuration files support variables like $basearch (architecture of the system, e.g., x86_64) or $releasever (version of the
operating system).
upvoted 1 times
Selected Answer: CD
It's correct
upvoted 1 times
For yum the “repos” are listed in the directory /etc/yum.repos.d/. Each repository is represented by a .repo file, like CentOS-Base.repo.
Additional, extra repositories can be added by the user by adding a .repo file in the directory mentioned above, or at the end of /etc/yum.conf.
However, the recommended way to add or manage repositories is with the yum-config-manager tool.
upvoted 2 times
CORRECT ANSWER IS DE
upvoted 1 times
Which of the following apt-get subcommands installs the newest versions of all currently installed packages?
A. auto-update
B. dist-upgrade
C. full-upgrade
D. install
E. update
Correct Answer: B
Selected Answer: B
the right answer is B. The update command updates only the repositories
upvoted 2 times
Selected Answer: B
is correct
upvoted 1 times
Efficiency-wise, you want to use dist-upgrade because it has an in-built conflict resolution feature! (Also, does what update does too)
upvoted 3 times
update (apt-get(8)): update is used to download package information from all configured sources. Other commands operate on this data to e.g.
perform package upgrades or search in and display details about all packages available for installation.
upgrade (apt-get(8)): upgrade is used to install available upgrades of all packages currently installed on the system from the sources configured
via sources.list(5). New packages will be installed if required to satisfy dependencies, but existing packages will never be removed. If an upgrade
for a package requires the removal of an installed package the upgrade for this package isn't performed.
full-upgrade (apt-get(8)): full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to
upgrade the system as a whole.
https://w w w .examtopics.com/exams/lpi/101-500/custom-view / 38/128
11/1/24, 11:57 101-500 Exam – Free Actual Q&As, Page 1 | ExamTopics
upvoted 3 times
I'm sorry
upvoted 7 times
Which command uninstalls a package but keeps its configuration files in case the package is re-installed?
A. dpkg -s pkgname
B. dpkg -L pkgname
C. dpkg -P pkgname
D. dpkg -v pkgname
E. dpkg -r pkgname
Correct Answer: E
Selected Answer: E
If it helps, you can think of using -r as telling the system to retain the configuration files for that package
upvoted 5 times
true, -r:
https://phoenixnap.com/kb/dpkg-command
upvoted 1 times
Which of the following commands lists the dependencies of the RPM package file foo.rpm?
D. rpm -R foo.rpm
Correct Answer: A
Selected Answer: A
answer is correct:
-q = query
-R = List capabilities on which this package depends (option of query parameter)
-p = package file
upvoted 7 times
The rpm -qpR foo.rpm command displays the requires information for the RPM package file foo.rpm. This includes the list of dependencies that
the package requires in order to be installed and run properly.
B. rpm -dep foo: This command displays the provides information for the RPM package file foo.rpm. Provides information indicates what
capabilities or services the package provides, not its dependencies.
C. rpm -ld foo.rpm: This command displays the list of files that are installed by the RPM package file foo.rpm. It does not provide information
about dependencies.
D. rpm -R foo.rpm: This command lists the files that are contained within the RPM package file foo.rpm. It does not provide information about
dependencies.
E. rpm -pD foo: This command displays the pre-install script for the RPM package file foo.rpm. The pre-install script is executed before the
package is installed, and it is not related to dependencies.
upvoted 1 times
What is the maximum niceness value that a regular user can assign to a process with the nice command when executing a new process?
A. 9
B. 15
C. 19
D. 49
E. 99
Correct Answer: C
1. Nice value goes as regular integer, where 19 is bigger than -20. If question would ask for highest priority - than it's -20.
2. Question asks about regular user. Regular user can not assign nice below 0.
upvoted 15 times
So it must be 19. The question ask about the maximum possible number not a maximum priotity user can assign where lower = higher pririoty
upvoted 7 times
Selected Answer: C
Which of the following commands list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user
Correct Answer: AD
Just tried the two highlighted options on RedHat Linux 9 and they work!
upvoted 5 times
Which of the following are valid stream redirection operators within Bash? (Choose two.)
A. <
B. #>
C. %>
D. >>>
E. 2>&1
Correct Answer: AE
2>&1 is used to redirect standard error output (2) to standard output (1), for example:
find / -name *.log > result.txt 2>&1: register errors in results.txt and don't display nothing
find / -name *.log > result.txt: display errors
upvoted 6 times
Which of the following vi commands deletes two lines, the current and the following line?
A. d2
B. 2d
C. 2dd
D. dd2
E. de12
Correct Answer: C
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?
B. dbmaint &>/dev/pts/null
D. bg dbmaint
E. wait dbmaint
Correct Answer: C
Selected Answer: C
The reason for this is nohup (“no hangup”) detaches dbmaint from the user who started it, and the & at the end tells the console to run dbmaint
in the background.
upvoted 6 times
From a Bash shell, which of the following commands directly execute the instructions from the file /usr/local/bin/runme.sh without starting a
subshell?
(Choose two.)
A. source /usr/local/bin/runme.sh
B. /usr/local/bin/runme.sh
C. /bin/bash /usr/local/bin/runme.sh
D. . /usr/local/bin/runme.sh
E. run /usr/local/bin/runme.sh
Correct Answer: AD
Create a script that outputs the shell level environmental variable using "echo $SHLVL". When you execute this script using source or dot (.) it will
display 1 showing that the script was executed in the current shell. When you execute the script using full path it will show 2, showing that the
script was executed in a subshell.
upvoted 9 times
A and D is correct.
source and . tested on Ubuntu.
upvoted 5 times
right A and D
upvoted 1 times
Be careful!
./ and source are not quite the same.
./script runs the script as an executable file, launching a new shell to run it
https://ss64.com/bash/source.html
upvoted 4 times
FILL BLANK -
Which program runs a command in specific intervals and refreshes the display of the program's output? (Specify ONLY the command without
Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the
A. i (lowercase)
B. p (lowercase)
C. P (uppercase)
D. U (uppercase)
E. u (lowercase)
Correct Answer: B
the shorter one (p) goes below cursor, the taller one (P) above.
upvoted 1 times
Which of the following commands changes all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks and stores the
result in newlist.txt?
Correct Answer: A
txt1.txt
atxt.txt
txtB.txt
Which of the following regular expressions turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt
A. s/^.txt/.bak/
B. s/txt/bak.txt/
C. s/txt$/bak.txt/
D. s/^txt$/.bak^/
E. s/[.txt]/.bak$1/
Correct Answer: C
Correct is C
upvoted 1 times
Selected Answer: C
C because $ will change the only "txt" at the end of the line. If there is no $ symbol the command will change the first part of the name of the
first file too.
upvoted 3 times
Selected Answer: C
answer is C
upvoted 2 times
C is the right
upvoted 4 times
aswer must be C
upvoted 2 times
Selected Answer: C
answer is C
upvoted 2 times
Which command must be entered before exiting vi to save the current file as filea.txt?
A. %s filea.txt
B. %w filea.txt
C. :save filea.txt
D. :w filea.txt
E. :s filea.txt
Correct Answer: D
Which of the following signals is sent to a process when the key combination Ctrl+C is pressed on the keyboard?
A. SIGTERM
B. SIGCONT
C. SIGSTOP
D. SIGKILL
E. SIGINT
Correct Answer: E
Ctrl + C will terminate the process after it has interrupted and stopped the running process. On the other hand, Ctrl + Z will only pause the
process temporarily, and send the running process to the background. The user is then able to run any other terminals processes in the
meantime, and once done, the user can again bring the paused process back to the foreground, by means of using the fg command inside the
terminal.
https://www.programmerhat.com/linux-ctrl-c/
upvoted 1 times
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?
B. foo | cp /tmp/foodata
Correct Answer: D
D is correct.
Keyword is 'tee'. Think of the letter 'T' where it sends information two-ways!
upvoted 11 times
tee command generally gives std. output to screen and at the same time output can be append to file with -a flag.
Condition: It needs a standard input via (|)
upvoted 2 times
What output will be displayed when the user fred executes the following command? echo 'fred $USER'
A. fred fred
B. fred /home/fred/
C. 'fred $USER'
D. fred $USER
E. 'fred fred'
Correct Answer: D
Selected Answer: D
Correct Tested
upvoted 1 times
Which of the following commands displays the path to the executable file that would be executed when the command foo is invoked?
A. lsattr foo
B. apropos foo
C. locate foo
D. whatis foo
E. which foo
Correct Answer: E
E
which: A command that searches for the executable file associated with the given command in the directories listed in the PATH environment
variable.
foo: The command for which you want to determine the executable file's path.
upvoted 1 times
When redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces?
A. -rep-space
B. -printnul
C. -nospace
D. -ignore-space
E. -print0
Correct Answer: E
Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing
spaces or newlines are correctly handled.
upvoted 10 times
UYFYUFUY
upvoted 2 times
Which of the following commands can be used to determine how long the system has been running? (Choose two.)
A. uptime
B. up
C. time --up
D. uname ג€"u
E. top
Correct Answer: AE
Selected Answer: AE
Yes, is correct
upvoted 2 times
ls > files
Correct Answer: B
Selected Answer: B
yep it is Bee
upvoted 2 times
Simple redirection:
> Will write stdout to a file ( if the file exists it will overwrite it)
>> Will append stdout to a file ( write to next line after the original data ends )
Both will create the file is it doesn't exist
upvoted 3 times
Which of the following files, located in a user's home directory, contains the Bash history?
A. .bashrc_history
B. .bash_histfile
C. .history
D. .bash_history
E. .history_bash
Correct Answer: D
it is repeated
upvoted 9 times
Which wildcards will match the following filenames? (Choose two.) ttyS0 ttyS1 ttyS2
A. ttyS[1-5]
B. tty?[0-5]
C. tty*2
D. tty[A-Z][012]
E. tty[Ss][02]
Correct Answer: BD
A. ls >-1
B. ls <<ERR
C. ls >&2
D. ls >>2
E. ls |error
Correct Answer: C
Which of the following commands displays the contents of a gzip compressed tar archive?
D. tar cf archive.tgz
Correct Answer: E
"tar zvf" is the correct, command tar work without the "-" character too (testing in rhel and same, and debian).
upvoted 8 times
z switch is for handling .tar.gz g zip files, the t switch list the contents without extracting the file, and f specifies the command is to use the
archive file name, the -v switch would help to show permissions, size, and timestamp but the answer E could exclude this as the question asks
about displaying the contents of the tar file.
https://www.hostdime.com/kb/hd/command-line/how-to-tar-untar-and-zip-files
upvoted 2 times
upvoted 1 times
Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
Correct Answer: B
A. :UPPER:
B. [A-Z]
C. !a-z
D. %C
E. {AZ}
Correct Answer: B
Selected Answer: B
B, very easy
A is incorrect
upvoted 1 times
FILL BLANK -
Which command is used to start another command with a given nice level? (Specify ONLY the command without any path or parameters.)
Given a log file loga.log with timestamps of the format DD/MM/YYYY:hh:mm:ss, which command filters out all log entries in the time period
Correct Answer: E
Selected Answer: E
E is correct, tested
upvoted 3 times
Instead of supplying an explicit device in /etc/fstab for mounting, what other options may be used to identify the intended partition? (Choose
two.)
A. LABEL
B. ID
C. FIND
D. NAME
E. UUID
Correct Answer: AE
A yum repository can declare sets of related packages. Which yum command installs all packages belonging to the group admintools?
Correct Answer: C
is correct.
upvoted 4 times
FILL BLANK -
What directory contains configuration files for additional yum repositories? (Specify the full path to the directory.)
it is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory. The values you define in
individual [repository] sections of the /etc/yum.conf file override values set in the [main] section.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-configuring_yum_and_yum_repositories
upvoted 10 times
A tricky question. Just think of it as, "who is in charge of the yum.repos.d file? Oh yeah, the /etc/yum.comf..."
upvoted 4 times
Additional, extra repositories can be added by the user by adding a .repo file in the directory mentioned above, or at the end of
/etc/yum.conf. However, the recommended way to add or manage repositories is with the yum-config-manager tool.
upvoted 1 times
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-configuring_yum_and_yum_repositories
upvoted 1 times
Unequivocal /etc/yum.conf
upvoted 1 times
Which of the following commands installs the GRUB boot files into the currently active file systems and the boot loader into the first partition
A. grub-install /dev/sda
B. grub-install /dev/sda1
D. grub-install /dev/sda0
Correct Answer: A
https://wiki.archlinux.org/title/GRUB#:~:text=Make%20sure%20to,the%20boot%20loader
A is right
for SCSI is going
/dev/sda(dev/hda1)
/dev/sdb(dev/hda2)
/dev/sdc(/dev/sdb1)
/dev/sdd(/dev/dfb2)
...
upvoted 1 times
/dev/sdd(/dev/hdb2)
upvoted 1 times
Selected Answer: A
"run grub-install, pointing it to the boot DEVICE (NOT the partition) and the directory where the boot partition is mounted."
source: LPIC -1 (101) Version 5.0 Learning Materials, Page 71
upvoted 2 times
Selected Answer: B
Which of the following files are found in the /boot/ file system? (Choose two.)
E. fsck binaries
Correct Answer: AC
A and D is correct
upvoted 31 times
Selected Answer: AD
A and D is correct
upvoted 1 times
Selected Answer: AD
A and D
upvoted 1 times
"Since the boot partition only stores the files needed by the bootloader, the initial RAM disk and kernel images, it can be quite small by today’s
standards."
source - "LPI Learning Materials: LPIC-1 (101)" Version 5.0, page 57
upvoted 1 times
Selected Answer: AD
AD for sure just execute the following command on centos - ls -al /boot
upvoted 3 times
Selected Answer: AD
You can find ramdisk and linux kernel files at boot partition.
upvoted 1 times
/boot contains files used to boot the OS right after the boot loader call them
upvoted 1 times
B: Why would Bash be in here if it's not related to booting? It should be of a later concern after booting.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-
verifying_the_initial_ram_disk_image#:~:text=Procedure%C2%A030.1.%C2%A0-,Verifying%20the%20Initial%20RAM%20Disk%20Image,-
As%20root%2C%20list
fsck comes after systemd in the boot process before this program is called /usr/lib/systemd
upvoted 1 times
Which file defines the network locations from where the Debian package manager downloads software packages?
A. /etc/dpkg/dpkg.cfg
B. /etc/apt/apt.conf.d
C. /etc/apt/apt.conf
D. /etc/dpkg/dselect.cfg
E. /etc/apt/sources.list
Correct Answer: E
Selected Answer: E
/etc/apt/sources.list
upvoted 2 times
When removing a package on a system using dpkg package management, which dpkg option ensures configuration files are removed as well?
A. --clean
B. --purge
C. --vacuum
D. --remove
E. --declare
Correct Answer: B
Correct.
-r will remove package but keep config files.
-p --purge will remove all including config files.
upvoted 5 times
Selected Answer: B
purge.
very easy
upvoted 1 times
Which of the following statements are correct when comparing Linux containers with traditional virtual machines (e.g. LXC vs. KVM)? (Choose
three.)
A. Containers are a lightweight virtualization method where the kernel controls process isolation and resource management.
B. Fully virtualized machines can run any operating system for a specific hardware architecture within the virtual machine.
C. Containers are completely decoupled from the host system's physical hardware and can only use emulated virtual hardware devices.
D. The guest environment for fully virtualized machines is created by a hypervisor which provides virtual and emulated hardware devices.
E. Containers on the same host can use different operating systems, as the container hypervisor creates separate kernel execution.
ABD is correct
upvoted 2 times
Another example is if you run your host OS on Ubuntu, then you will be able to run RHEL and CentOS in your containers but not Window OS.
C is traditional KVM
With E, yes if hypervisor was replaced with container namespace and the same kernel execution were referenced, then this would be
accurate. So choice E is wrong. However, LXC does focus on OS containerization and the goal is to not need a separate kernel.
https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html
upvoted 1 times
The installation of a local Debian package failed due to unsatisfied dependencies. Which of the following commands installs missing
B. apt-get autoinstall
C. dpkg-reconfigure --all
D. apt-get all
E. apt-get install -f
Correct Answer: E
Selected Answer: E
E. apt-get install -f
upvoted 1 times
Which of the following commands lists all currently installed packages when using RPM package management?
Correct Answer: E
Which of the following commands are valid in the GRUB 2 configuration file? (Choose two.)
A. menuentry
B. uefi
C. pxe-ifconfig
D. insmod
E. kpartx
Correct Answer: AD
insmod:
dir: https://www.gnu.org/software/grub/manual/grub/grub.html#insmod
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-
working_with_the_grub_2_boot_loader
https://help.ubuntu.com/community/Grub2/Installing#:~:text=The%20GRUB%202%20menu%20is%20built%20by%20information%20containe
d%20in%20/boot/grub/grub.cfg
pxe-ifconfig is invalid
Selected Answer: AD
A. menuentry
D. insmod
upvoted 1 times
Correct Answer: A
Selected Answer: A
What can the Logical Volume Manager (LVM) be used for? (Choose three.)
A. To create snapshots.
Snapshot Creation: LVM supports the creation of read-only or read-write snapshots of logical volumes. Snapshots are useful for data backup,
testing, and other purposes (A)
Dynamic Volume Management: LVM allows you to create, resize, and manage logical volumes without the need to repartition your hard drives.
This makes it easier to adapt your storage configuration as your needs change (B)
Encryption: LVM can be used in conjunction with encryption technologies to create encrypted logical volumes for enhanced data security (E)
Looks like A,B,E right choices for this question. C should be false since you can only create, resize and manage logical volumes. D is false since
data striping or mirroring does not concern with raid 9 type.
upvoted 1 times
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 4 TB, whereas GPT supports partition sizes up to 128 ZB.
B. By default, GPT can manage up to 128 partitions while MBR only supports four primary partitions.
C. By default, GPT can manage up to 64 partitions while MBR only supports 16 primary partitions.
D. MBR can handle partition sizes up to 2.2 TB, whereas GPT supports sizes up to 9.4 ZB.
E. Both GPT and MBR support up to four primary partitions, each with up to 4096 TB.
Correct Answer: BD
Selected Answer: BD
A backup software heavily uses hard links between files which have not been changed in between two backup runs. Which benefits are
A. The old backups can be moved to slow backup media, such as tapes, while still serving as hard link target in new backups.
B. The backup runs faster because hard links are asynchronous operations, postponing the copy operation to a later point in time.
C. The backup is guaranteed to be uncharged because a hard linked file cannot be modified after its creation.
D. The backup consumes less space because the hard links point to the same data on disk instead of storing redundant copies.
E. The backup runs faster because, instead of copying the data of each file, hard links only change file system meta data.
Correct Answer: AD
Selected Answer: DE
Selected Answer: DE
D and E definitely.
upvoted 1 times
Selected Answer: DE
Selected Answer: DE
Selected Answer: DE
is Correct
upvoted 1 times
FILL BLANK -
Which file from the /proc/ file system contains a list of all currently mounted devices? (Specify the full name of the file, including path.)
A. 3
B. 4
C. 5
D. 6
E. 7
Correct Answer: D
Mount point - The point where it can access the device / partition (the /)
Options - rg. dmask=027, fmask=137 (Cause umask=000 would make everything executable)
Pass num - Order of whick fsck will check the device/partition (Root should be 1, other partitions should be 2.)
upvoted 5 times
Running chmod 640 filea.txt as a regular user doesn't update filea.txt's permission. What might be a reason why chmod cannot modify the
A. filea.txt is owned by another user and a regular user cannot change the permissions of another user's file.
B. filea.txt is a symbolic link whose permissions are a fixed value which cannot be charged.
C. filea.txt has the sticky bit set and a regular user cannot remove this permission.
D. filea.txt is a hard link whose permissions are inherited from the target and cannot be set directly.
E. filea.txt has the SetUID bit set which imposes the restriction that only the root user can make changes to the file.
Correct Answer: AB
filea.txt is a symbolic link whose permissions are a fixed value which cannot be cha"N"ged.
upvoted 7 times
Selected Answer: AB
Selected Answer: AB
Is correct answer
upvoted 1 times
are correct
upvoted 1 times
Selected Answer: AB
you can change the permissions on a hard link file without issues due it will be change the permissions in the original source too. You cannot
change the permissions on symbolic inks due all is under 777
upvoted 4 times
Wait, isn't D is more correct? A hardlink permission is inherited and cannot be changed by anyone else but root/owner
upvoted 1 times
Which of the following Linux filesystems preallocate a fixed number of inodes when creating a new filesystem instead of generating them as
A. JFS
B. ext3
C. XFS
D. ext2
E. procfs
Correct Answer: BD
Selected Answer: BD
Which of the following commands sets the SetUID permission on the executable /bin/foo?
Correct Answer: A
Selected Answer: A
For the special permissions, you prepend these numbers with another number
where 4 is setuid, 2 is setgid, and 1 is the sticky bit
upvoted 8 times
Selected Answer: A
Correct Answer: A
upvoted 1 times
To remove it:
~$ chmod 0755 test-SetUID
~$ ls -l test-SetUID
-rwxr-xr-x 1 neo neo 0 jul 1 19:20 test-SetUID
upvoted 2 times
Which of the following commands can be used to display the inode number of a given file? (Choose two.)
A. inode
B. ln
C. ls
D. cp
E. stat
Correct Answer: CE
Selected Answer: CE
ls -i ist correct
upvoted 1 times
Selected Answer: CE
Affirmative CE
upvoted 1 times
Which of the following settings for umask ensures that new files have the default permissions -rw-r-----?
A. 0017
B. 0640
C. 0038
D. 0227
E. 0027
Correct Answer: E
Selected Answer: E
Default permissions:
777 = default permissions for directories
666 = default for files
-0/6/4/0
0/1/3/7
can someone explain please?
upvoted 2 times
After a power outage, the XFS file system of /dev/sda3 is inconsistent. How can the existing file system errors be fixed?
Correct Answer: E
Which of the following properties of an existing file changes when a hard link pointing to that file is created?
A. File size
B. Link count
C. Modify timestamp
D. Inode number
E. Permissions
Correct Answer: B
Selected Answer: B
B. Link count
Is correct
Also this does not apply to *soft* links , as they will not increase link count
upvoted 5 times
Selected Answer: B
Correct answer: B
Example:
ln zip_3.0-13_amd64.deb zip_3_hardlink.deb
ls -li
FILL BLANK -
Following the Filesystem Hierarchy Standard (FHS), where should binaries that have been compiled by the system administrator be placed in
order to be made available to all users on the system? (Specify the full path to the directory.)
/usr/bin contains executables for users to use. Most of non booting programs, intended for normal users, should be placed here.
/sbin/ contains boot binaries, and other executables tipically not used for nnormal users.
/usr/local/bin usually contains non system, third party locally compiled binaries. Default location for user binaries.
https://eslinux.com/foro/1542/diferencia-sbin-bin/ (SPA)
upvoted 21 times
Which of the following commands show how the shell handles a specific command?
A. where
B. type
C. stat
D. case
E. fileinfo
Correct Answer: B
https://www.howtogeek.com/426014/how-to-use-the-linux-type-command/
upvoted 4 times
When in Normal mode in vi, which character can be used to begin a reverse search of the text?
A. r
B. /
C. F
D. ?
E. s
Correct Answer: D
Selected Answer: D
D. ?
correct
upvoted 1 times
Which of the following commands displays the manual page command from section 1?
A. man command(1)
B. man command@1
C. man 1 command
D. man 1.command
E. man -s 1 command
Correct Answer: C
Which of the following commands creates or, in case it already exists, overwrites a file called data with the output of ls?
A. ls 3> data
B. ls >& data
C. ls > data
D. ls >> data
E. ls >>> data
Correct Answer: C
Selected Answer: C
C
very easy and basic
upvoted 2 times
Which of the following commands is used to change options and positional parameters within a running Bash shell?
A. history
B. setsh
C. bashconf
D. set
E. envsetup
Correct Answer: D
Selected Answer: D
set
very basic
upvoted 2 times
Which of the following commands display the IDs of all processes owned by root? (Choose two.)
A. pgrep -c root
B. pgrep -u root
C. pgrep -f root
D. pgrep -U 0
E. pgrep -c 0
Correct Answer: BD
Selected Answer: BD
B and D
upvoted 3 times
Selected Answer: BD
What is pgrep?
Look at running processes and lists the process ID to STDOUT.
For example:
pgrep -u root sshd
Will only list the process ID's that are owned by root (user).
https://w w w .examtopics.com/exams/lpi/101-500/custom-view / 96/128
11/1/24, 11:57 101-500 Exam – Free Actual Q&As, Page 1 | ExamTopics
Example 2:
pgrep -u user -l
Will list the process ID and name used by 'user'.
-c count
-u user
-l list process name as will as process ID
upvoted 5 times
(To whom is validating our comments... Please tell whoever may care, to do his/ her the f job and do correct the tests: Who wants to purchase
anything full of mistakes? TY xD )
upvoted 3 times
Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose two.)
A. Ctrl XX
B. Ctrl :W
C. Esc zz
D. Esc :wq
E. Esc ZZ
Correct Answer: DE
Selected Answer: DE
Tested works
upvoted 2 times
D. It changes the output order showing the last matching line first.
Correct Answer: C
Selected Answer: C
Which of the following tools can show the complete path of an executable file that the current shell would execute when starting a command
A. find
B. pwd
C. which
D. locate
E. type
Correct Answer: CE
Selected Answer: CE
C and E is correct.
locate would also show other Files and excecutables outside the $PATH directories. So it does not match the requirements of the question.
upvoted 1 times
Selected Answer: CD
C&E not D
upvoted 1 times
C and D.
E is incorrect
upvoted 2 times
Selected Answer: CD
Which of the following signals is sent to a process when the key combination Ctrl+Z is pressed on the keyboard?
A. SIGTERM
B. SIGCONT
C. SIGSTOP
D. SIGKILL
E. SIGINT
Correct Answer: C
Selected Answer: C
ctrl+z is SIGSTOP
upvoted 1 times
upvoted 2 times
What is the output when the regular expression s/[ABC] [abc]/xx/ is applied to the following string?
ABCabc -
A. ABxxbc
B. xxCxxc
C. xxxxxx
D. ABCabc
E. Axxaxx
Correct Answer: C
Selected Answer: D
The regular expression s/[ABC] [abc]/xx/ attempts to match a single character from the set [ABC] (i.e., A, B, or C), followed by a space, and then
another single character from the set [abc] (i.e., a, b, or c).
In the given string ABCabc, there is no occurrence where a space follows a character from the set [ABC]. Therefore, the regular expression doesn’t
find any matches within the string, resulting in no changes to the original string.
Hence, the output remains the same as the input string: ABCabc.
upvoted 1 times
Selected Answer: A
Selected Answer: A
the answer is a
upvoted 1 times
Selected Answer: D
Running the command echo "ABCabc" | sed "s/[ABC] [abc]/xx/" in Ubuntu 20.04 returns the result "ABCabc", so the correct answer is D.
upvoted 1 times
Running the command without quotes or a space returns "ABxxbc", so I don't know which one is correct.
upvoted 1 times
A for sure
upvoted 1 times
Selected Answer: A
Selected Answer: A
A is correct
upvoted 1 times
Selected Answer: A
FOR ME IS A
upvoted 1 times
Which of the following commands print the current working directory when using a Bash shell? (Choose two.)
A. echo ג€${PWD}ג€
B. echo ג€${WD}ג€
C. printwd
D. pwd
E. echo ג€${pwd}ג€
Correct Answer: AD
Correct Answer: E
the command is
cat << EOT
>test
>EOT
upvoted 19 times
Selected Answer: E
E is correct
#cat <<ENDofTEXT
>test
>ENDofTEXT
upvoted 5 times
Selected Answer: E
Tested for sure E, EOT can be anything i.e. Linux as long as it is typed last to end the text input
upvoted 1 times
Code:
ftp -inv $host << FTP ## start of label, below command will be treated as ftp command not the shell commans
user $user $passwd
bin
put $file
bye
FTP # end of ftp commands
ls ## shell commands again
https://www.unix.com/shell-programming-and-scripting/128056-command-eot.html
upvoted 2 times
What is the default nice level when a process is started using the nice command?
A. -10
B. 0
C. 10
D. 15
E. 20
Correct Answer: B
C is correct answer
upvoted 14 times
Selected Answer: C
The default "nice level", which is set for processes started using the nice command in Unix systems, is 10. This means that if you start a process
using the nice command without specifying the "nice" value, the process will receive a "nice" value set to 10.
upvoted 1 times
Selected Answer: C
niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).
Selected Answer: C
C i think
upvoted 1 times
Selected Answer: C
$ ps -l 13713
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 S 1000 13713 13655 0 90 10 - 864 hrtime pts/0 0:00 sleep 200
upvoted 1 times
Selected Answer: C
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remote that directory?
A. rmdir ~/\\dir
B. rmdir ג€~/\dirג€
C. rmdir ~/'dir'
D. rmdir ~/\dir
E. rmdir '~/\dir'
Correct Answer: D
People pointing answers C and D are not creating the directory with the leading \. To do that you need do use mkdir "\dir" since mkdir \dir will
create a directory named only "dir". Thats why C and D are working for them.
Correct answer is A.
upvoted 18 times
Selected Answer: A
folder = \dir
upvoted 1 times
$ mkdir dir
$ ls dir
$ ls d*
dexample.gz.tar
dir:
rmdir ~/\dir
$ ls d*
dexample.gz.tar
$ mkdir dir
sblanco@idp:~$ rmdir ~/'dir'
sblanco@idp:~$ ls d*
dexample.gz.tar
$ mkdir dir
$ rmdir ~/'dir'
$ ls d*
dexample.gz.tar
upvoted 1 times
Selected Answer: A
A is correct, I tested
upvoted 1 times
Selected Answer: A
A: seen as correct in another guide and tested in my home directory as regular user, cemtos 7, not root:
mkdir "\dir"
ls -l
\dir
then tried the different deleting options and the only working was A, no need to use any quotation marks.
upvoted 1 times
A is correct
upvoted 1 times
Selected Answer: A
A is correct
upvoted 1 times
Selected Answer: A
Tested it is A
upvoted 2 times
Selected Answer: A
\ for escaping
upvoted 3 times
Selected Answer: A
Which of the following commands can perform searches on file contents using regular expressions?
A. find
B. locate
C. grep
D. reggrep
E. pgrep
Correct Answer: C
Selected Answer: C
grep
very easy
upvoted 1 times
In a nested directory structure, which find command line option would be used to restrict the command to searching down a particular number
of subdirectories?
A. -maxdepth
B. -dirmax
C. -maxlevels
D. -s
E. -n
Correct Answer: A
Selected Answer: A
It is A
i checked the --help
upvoted 1 times
Selected Answer: A
A definitely and it is in MAN page, there are both maxdepth and mindepth
upvoted 2 times
my recommendation is that if you have any doubts, look for the man page directly in google.
upvoted 3 times
Which of the following commands determines a file's format by using a definition database file which contains information about all common
file types?
A. type
B. file
C. magic
D. pmagic
E. hash
Correct Answer: B
Selected Answer: B
Selected Answer: B
https://phoenixnap.com/kb/linux-file-command
upvoted 2 times
Which of the following commands generates a list of user names from /etc/passwd along with their login shell?
Correct Answer: E
Selected Answer: E
If the gzip compressed tar archive texts.tgz contains the files a.txt and b.txt, which files will be present in the current directory after running
gunzip texts.tgz?
E. Only texts.tar
Correct Answer: B
Selected Answer: E
tried on ubuntu
upvoted 1 times
Selected Answer: E
E:
[root@centos-vm TAR-TESTING]# tar -czf texts.tgz a.txt b.txt
[root@centos-vm TAR-TESTING]# ls -l
total 4
-rw-r--r--. 1 root root 0 Nov 20 13:58 a.txt
-rw-r--r--. 1 root root 0 Nov 20 13:58 b.txt
-rw-r--r--. 1 root root 117 Nov 20 13:59 texts.tgz
[root@centos-vm TAR-TESTING]# rm -rf a.txt b.txt
[root@centos-vm TAR-TESTING]# ls -l
total 4
-rw-r--r--. 1 root root 117 Nov 20 13:59 texts.tgz
[root@centos-vm TAR-TESTING]# gunzip texts.tgz
[root@centos-vm TAR-TESTING]# ls -l
total 12
-rw-r--r--. 1 root root 10240 Nov 20 13:59 texts.tar
[root@centos-vm TAR-TESTING]#
upvoted 5 times
Selected Answer: E
I think is E
upvoted 1 times
E 100%
upvoted 2 times
Selected Answer: E
E is correct
upvoted 2 times
Selected Answer: E
E.....asy
upvoted 1 times
In the vi editor, how can commands such as moving the cursor or copying lines into the buffer be issued multiple times or applied to multiple
rows?
A. By using the command :repeat followed by the number and the command
C. By selecting all affected lines using the shit and cursor keys before applying the command.
D. By issuing a command such as :set repetition=4 with repeats every subsequent command 4 times.
Correct Answer: B
Which of the following statements is correct for a command ending with an & character?
Correct Answer: B
Selected Answer: B
Which of the following commands reads a file and creates separate chunks of a given size from the file's contents?
A. ar
B. cat
C. break
D. split
E. parted
Correct Answer: D
Selected Answer: D
B. It repeats the execution of a command using different parameters for each invocation.
E. It allows specifying long options (like --help) for commands that normally only accept short options (like -h)
Correct Answer: C
Example:
The command uses xargs to create directories in the ~/tests/ path with usernames obtained from the /etc/passwd file:
tail /etc/passwd | cut -d":" -f1 | xargs -I {} mkdir -p ~/tests/{}
upvoted 1 times
FILL BLANK -
Which command displays a list of all background tasks running in the current shell? (Specify ONLY the command without any path or
parameters.)
FILL BLANK -
Which command is used to change the priority of an already running process? (Specify ONLY the command without any path or parameters.)
Correct Answer: B
Selected Answer: B
B:
0: stdin, 1: stout, 2: sterr
upvoted 6 times
When booting from the hard disk, a computer successfully loads the Linux kernel and initramfs but hangs during the subsequent startup tasks.
The system is booted using a Linux based rescue CD to investigate the problem. Which of the following methods helps to identify the root
A. Using the dmesg command from the rescue CD's shell to view the original system's boot logs.
B. Investigating the file /proc/kmsg on the computer's hard disk for possible errors.
C. Investigating the file /var/log on the computer's hard disk for possible errors.
D. Using chroot to switch to the file system on the hard disk and use dmesg to view the logs.
E. Rebooting again from the hard drive since the system successfully booted from the rescue CD.
Correct Answer: C
In this example, it was successfully rebooted with a rescue disk, hence one needs to go look at /var/logs because your OS transferred it there!
upvoted 13 times
I had a hard time with this one. All options are wrong to me, even option C.
It says, "Investigating the file /var/log ...", but /var/log is not a file; it is a directory.
It is not well written.
upvoted 1 times
Correct Answer: C
What is the correct way to set the default systemd boot target to multi-user?
Correct Answer: D
Which of the following statements are correct about the initial RAM disk involved in the boot process of Linux? (Choose two.)
A. An initramfs is a compressed file system archive, which can be unpacked to examine its contents.
B. An initramfs file contains the MBR, the bootloader and the Linux kernel.
D. The kernel uses the initramfs temporarily before accessing the real root file system.
E. An initramfs does not depend on a specific kernel version and is not changed after the initial installation.
Correct Answer: AC
Selected Answer: AD
AD is correct
upvoted 1 times
Selected Answer: AD
Selected Answer: AD
A and D
upvoted 2 times
containing a filesystem used as a temporary root filesystem during the boot process. The main
purpose of an initramfs file is to provide the required modules so the kernel can access the “real”
root filesystem of the operating system.
upvoted 3 times
I go with A and D
upvoted 2 times
Selected Answer: AD
Which of the following commands loads a kernel module along with any required dependency modules?
A. depmod
B. modprobe
C. module_install
D. insmod
E. loadmod
Correct Answer: B
https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-
configuration/Working_with_Kernel_Modules/
upvoted 6 times
What information can the lspci command display about the system hardware? (Choose three.)
FILL BLANK -
Which System V init configuration file is commonly used to set the default run level? (Specify the full name of the file, including path.)
/etc/rc1.d/K01apache2
/etc/rc2.d/S02apache2
When are the scripts executed that are referenced by these links? (Choose two.)
Correct Answer: AC
Selected Answer: AC
A. S02apache2 is run when runlevel 2 is entered. This is because the symbolic link in /etc/rc2.d starts with the letter "S", which stands for "Start",
and is followed by a number that determines the order in which the scripts are executed when entering the corresponding runlevel.
C. K01apache2 is never run because K indicates a deactivated service. This is because the symbolic link in /etc/rc1.d starts with the letter "K",
which stands for "Kill", and is followed by a number that determines the order in which the scripts are executed when leaving the corresponding
runlevel.
Selected Answer: AE
AE:
Regarding the E, we all agree that K indicates that THE SERVICE (apache2) won't take place in run level 1.
But the question (and is somewhat ambiguous wording) ask about THE SCRIPT itself that will deactivate apache2.
By following the logic of https://www.golinuxhub.com/2014/01/what-are-s-and-k-scripts-in-etc-rcxd/, the K scripts are in deed executed to stop
the service.
So, if the option C didn't include the K01 and just refer to the apache2 service that would be correct. But again, the reasoning of the question
refers to the script itself, or at least that is the way it is written.
upvoted 3 times
Selected Answer: AE
A and E
upvoted 2 times
The first letter of the link filename in the runlevel’s directory indicates if the service should be started or terminated for the corresponding
runlevel. A link’s filename starting with letter K determines that the service will be killed when entering the runlevel (kill).
Ref: https://learning.lpi.org/en/learning-materials/101-500/101/101.3/101.3_01/
upvoted 4 times
I think that K01apache2 script (Answer C) is read by the OS and is promptly killed before the service can be started / has already started.
"deactivated service" may not apply because the service could have been started prior to the scripts being executed.
On the other hand, for me A is correct. E is wrong, that script will be run when leaving runlevel 1. C might be correct, because runlevel 1 is
single-user mode used for system maintenance, and in that state, services are restricted to bare-minimum, and apache might be
deactivated in that runlevel.
upvoted 1 times