---
title: "LPIC-1 101 QUESTIONS"
tags: linux,lpic-1,lpi-101
author:
source:
description: Preguntas recopiladas de exámenes LPIC-1
aliases:
cssclass:
publish:
date: YYYY-MM-DD HH:MM:SS +/-es.ES
---
1. **What information can the lspci command display about the system hardware? (Choose THREE correct answers.)**
* ==Device IRQ settings==
* ==PCI bus speed==
* System battery type
* ==Device vendor identification==
* Ethernet MAC address
1. **During a system boot cycle, what program is executed after the BIOS completes its tasks?**
* ==The bootloader==
* The inetd program
* The init program
* The kernel
1. **Which command displays the contents of the Kernel Ring Buffer on the command line? (Provide only the command name without any options or path information)**
* ==**`dmesg`**==, ==**`/bin/dmesg`**==
1. **Which of the following characters can be combined with a separator string in order to read from the current input source until the separator string, which is on a separate line and without any trailing spaces, is reached?**
* ==**`<<`**==
* `<|`
* `!<`
* `&<`
1. **Which of the following commands brings a system running SysV init into a state in which it is safe to perform maintenance tasks? (Choose TWO correct answers.)**
* `shutdown -R 1 now`
* `shutdown -single now`
* ==**`init 1`**==
* ==**`telinit 1`**==
* `runlevel 1`
1. **Which of the following options for the kernel's command line changes the systemd boot target to rescue.target instead of the default target?**
* `systemd.target=rescue.target`
* `systemd.runlevel=rescue.target`
* `systemd.service=rescue.target`
* `systemd.default=rescue.target`
* ==**`systemd.unit=rescue.target`**==
1. **Which of the following are init systems used within Linux systems? (Choose THREE correct answers.)**
* startd
* ==systemd==
* ==Upstart==
* SysInit
* ==SysV init==
1. **Which command will disable swapping on a device? (Specify ONLY the command without any path or parameters.)**
* ==**swapoff**==, ==**/sbin/swapoff**==
1. **In which directory must definition files be placed to add additional repositories to yum?**
* ==**/etc/yum.repos.d**==, ==**/etc/yum.repos.d/**==, ==**yum.repos.d**==, ==**yum.repos.d/**==
1. **Which RPM command will output the name of the package which supplied the file `/etc/exports`?**
* `rpm -F /etc/exports`
* ==**`rpm -qf /etc/exports`**==
* `rpm -Kl /etc/exports`
* `rpm -qp /etc/exports`
* `rpm -qi/etc/exports`
1. **Which of the following commands overwrites the bootloader located on `/dev/sda` without overwriting the partition table or any data following it?**
* `dd if=/dev/zero of=/dev/sda bs=512`
* `dd if=/dev/zero of=/dev/sda bs=512 count=1`
* ==**`dd if=/dev/zero of=/dev/sda bs=440 count=1`**==
* `dd if=/dev/zero of=/dev/sda bs=440`
1. **Which of the following environment variables overrides or extends the list of directories holding shared libraries?**
* `LD_LOAD_PATH`
* `LD_LIB_PATH`
* ==**`LD_LIBRARY_PATH`**==
* `LD_SHARE_PATH`
* `LD_RUN_PATH`
1. **Which of the following commands lists all currently installed packages when using RPM package management?**
* `yum --query --all`
* `yum --list --installed`
* ==**`rpm --query --all`**==
* `rpm --list –installed`
1. **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?**
* `hidemenu`
* `splash`
* ==**`timeout`**==
* `showmenu`
1. **What is the difference between the `--remove` and the `--purge` action with the `dpkg` command?**
* ==**`--remove` removes the program, `--purge` also removes the config files**==
* `--remove` only removes the program, `--purge` only removes the config files
* `--remove` removes a package, `--purge` also removes all packages dependent on it
* `--remove` removes only the package file itself, `--purge` removes all files related to the package
1. **Which of the following commands is used to update the list of available packages when using dpkg based package management?**
* ==**`apt-get update`**==
* `apt-get upgrade`
* `apt-cache update`
* `apt-get refresh`
* `apt-cache upgrade`
1. **Which function key is used to start Safe Mode in Windows NT?**
* F10
* F8
* F6
* ==**Windows NT does not support Safe Mode**==
1. **Typically, which top level system directory is used for files and data that change regularly while the system is running and are to be kept between reboots? (Specify only the top level directory)**
* ==Mastered==
* Not Mastered
Explanation:
**/var, /var/, var, var/**
1. **What can the Logical Volume Manager (`LVM`) be used for? (Choose THREE correct answers.)**
* To create RAID 9 arrays.
* ==**To dynamically change the size of logical volumes.**==
* To encrypt logical volumes.
* ==**To create snapshots.**==
* ==**To dynamically create or delete logical volumes.**==
1. **Which of the following commands will reduce all consecutive spaces down to a single space?**
* `tr '\s' ' ' < a.txt > b.txt`
* `tr -c ' ' < a.txt > b.txt`
* `tr -d ' ' < a.txt > b.txt`
* `tr -r ' ' '\n' < a.txt > b.txt`
* ==**`tr -s ' ' < a.txt > b.txt`**==
1. **The /etc/________ file lists currently mounted devices.**
* ==**`mtab`**==
1. **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?**
* magic
* type
* ==file==
* pmagic
* hash
1. **Which of the following commands displays the contents of a gzip compressed tar archive?**
* `gzip archive.tgz | tar xvf -`
* ==**`tar ztf archive.tgz`**==
* `gzip -d archive.tgz | tar tvf -`
* `tar cf archive.tgz`
1. **In Bash, inserting `1>&2` after a command redirects**
* standard error to standard input.
* standard input to standard error.
* ==**standard output to standard error.**==
* standard error to standard output.
* standard output to standard input.
1. **In the `vi` editor, which of the following commands will copy the current line into the `vi` buffer?**
* `c`
* `cc`
* `1c`
* ==**`yy`**==
* `1y`
1. **Which `grep` command will print only the lines that do not end with a `/` in the file `foo`?**
* `grep'/$' foo`
* `grep '/#' foo`
* ==**`grep -v '/$' foo`**==
* `grep -v '/#' foo`
1. **What command will generate a list of user names from `/etc/passwd` along with their login shell?**
* `column -s : 1,7 /etc/passwd`
* `chop -c 1,7 /etc/passwd`
* `colrm 1,7 /etc/passwd`
* ==**cut -d: -f1,7 /etc/passwd**==
1. **What is the effect of the `egrep` command when the `-v` option is used?**
* It enables color to highlight matching parts.
* ==**It only outputs non-matching lines.**==
* It shows the command's version information.
* It changes the output order showing the last matching line first.
1. **Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?**
* `fmt -f 1,4 /etc/passwd`
* `split -c 1,4 /etc/passwd`
* ==**`cut -d : -f 1,4 /etc/passwd`**==
* `paste -f 1,4 /etc/passwd`
* `split –c 1,4 /etc/passwd`
1. **Which of the following commands replaces each occurrence of `'bob'` in the file letter with `'Bob'` and writes the result to the file newletter?**
* `sed '/bob/Bob' letter > newletter`
* `sed s/bob/Bob/ letter < newletter`
* `sed's/bob/Bob' letter > newletter`
* ==**`sed 's/bob/Bob/g' letter > newletter`**==
* `sed 's/bob, Bob/' letter > newletter`
1. **What is the maximum niceness value that a regular user can assign to a process with the nice command when executing a new process?**
* `9`
* ==**`19`**==
* `49`
* `99`
1. **Which of the following commands prints all files and directories within the `/tmp` directory or its subdirectories which are also owned by the user root? (Choose TWO correct answers.)**
* `find /tmp -uid root -print`
* `find -path /tmp -uid root`
* ==**`find /tmp -user root -print`**==
* ==**`find /tmp -user root`**==
* `find -path /tmp -user root –print`
1. **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?**
* By using the command :repeat followed by the number and the command.
* ==**By specifying the number right in front of a command such as `4l` or `2yj`.**==
* By selecting all affected lines using the shift and cursor keys before applying the command.
* By issuing a command such as `:set repetition=4` which repeats every subsequentcommand 4 times.
1. **Which shell command is used to continue background execution of a suspended command?**
* `&`
* ==**`bg`**==
* `cont`
* `exec`
* `:&`
1. **Which command displays a list of all background tasks running in the current shell? (Specify ONLY the command without any path or parameters.)**
* ==**`jobs`**==
1. **Which of the following commands can be used to create a USB storage media from a disk image?**
* `gdisk`
* ==**`dd`**==
* `cc`
* `fdisk`
* `mount`
1. **Which of the following commands is used to change options and positional parameters for a running Bash?**
* `history`
* ==**`set`**==
* `bashconf`
* `setsh`
* `envsetup`
1. **When running the command `sed -e "s/a/b/" /tmp/file >/tmp/file`
While `/tmp/file` contains data, why is `/tmp/file` empty afterwards?**
* The file order is incorrect
* The destination file must be mentioned before the command to ensure redirection.
* ==**The command sed did not match anything in that file therefore the output is empty.**==
* When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens itfor reading.
* Redirection for shell commands do not work using the `>` character
* It only works using the `|` character instead.
1. **Which command is used in a Linux environment to create a new directory? (Specify ONLY the command without any path or parameters.)**
* ==**`mkdir`**==, ==**`/usr/bin/mkdir`**==
1. **What is the output of the following command?**
**`echo "Hello World" | tr -d aieou`**
* `Hello World`
* `eoo`
* ==**`Hll Wrld`**==
* `eoo Hll Wrld`
1. **A user accidentally created the subdirectory `\dir` in his home directory. Which of the following commands will remove that directory?**
* `rmdir '~/\dir'`
* `rmdir "~/\dir"`
* `rmdir ~/'dir'`
* `rmdir ~/\dir`
* ==**`rmdir ~/\\dir`**==
1. **Regarding the command:**
**`nice -5 /usr/bin/prog`**
**Which of the following statements is correct?**
* `/usr/bin/prog` is executed with a nice level of -5.
* ==**`/usr/bin/prog` is executed with a nice level of 5.**==
* `/usr/bin/prog` is executed with a priority of -5.
* `/usr/bin/prog` is executed with a priority of 5.
1. **What is the default action of the `split` command on an input file?**
* It will break the file into new files of 1,024 byte pieces each.
* ==**It will break the file into new files of 1,000 line pieces each.**==
* It will break the file into new files of 1,024 kilobyte pieces each.
* It will break the file into new files that are no morethan 5% of the size of the original file.
1. **Which signal is missing from the following command that is commonly used to instruct a daemon to reinitialize itself, including reading configuration files?**
**`killall -s ______ daemon`**
* ==**`SIGHUP`**==
1. **Which of the following statements is correct regarding the command `foo 1> bar`?**
* The stdout from the command foo is appended to the file bar.
* ==**The stdout from the command foo overwrites the file bar.**==
* The command foo receives its stdin from the file bar.
* The command foo receives its stdin from the stdout of the command bar.
* The stderr from the command foo is saved to the file bar.
1. **Which of the following commands kills the process with the PID `123` but allows the process to "clean up" before exiting?**
* `kill -PIPE 123`
* `kill -KILL 123`
* `kill -STOP 123`
* ==**`kill -TERM 123`**==
1. **You are trying to make a hard link to an ordinary file but ln returns an error. Which of the following could cause this?**
* The source file is hidden.
* The source file is read-only.
* The source file is a shell script.
* You do not own the source file.
* ==**The source and the target are on different filesystems.**==
1. **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?**
* ==**`/usr/local/bin/`**==
1. **Which of the following commands will produce the following output?**
```shell
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Nov04 ? 00:02:38 /sbin/init
root 2 0 0 Nov04 ? 00:00:02 [kthreadd]
root 3 2 0 Nov04 ? 00:00:40 [ksoftirqd/0]
root 5 2 0 Nov04 ? 00:00:00 [kworker/0:0H]
root 7 2 0 Nov04 ? 00:33:19 [rcu_sched]
root 8 2 0 Nov04 ? 00:00:00 [rcu_bh]
```
* `jobs`
* `proclist`
* `netstat`
* ==**`ps`**==
1. **Which of the following commands is used to modify quota settings? (Choose two.)**
* `editquota`
* ==**`setquota`**==
* ==**`edquota`**==
* `quotaedit`
* `quotaset`
1. **Which of the following commands instructs SysVinit to reload its configuration file?**
* `reinit`
* `initreload`
* `telinit 7`
* ==**`telinit q`**==
* `init reinit`
1. **Which command is used to create and initialize the files used to store quota information? (Specify ONLY the command without any path or parameters.)**
* ==**`quotacheck`**==
1. **After successfully creating a hard link called `bar` to the ordinary file `foo`, `foo` is deleted from the filesystem. Which of the following describes the resulting situation?**
* `foo` and `bar` would both be removed.
* ==**`foo` would be removed while `bar` would remain accessible.**==
* `foo` would be remove
* `bar` would still exist but would be unusable.
* Both `foo` and `bar` would remain accessible.
* The user is prompted whether `bar` should be removed, too.
1. **What do the permissions `-rwSr-xr-x` mean for a binary file when it is executed as a command?**
* The command is SetUID and it will be executed with the effective rights of the owner.
* The command will be executed with the effective rights of the group instead of the owner.
* ==**The execute flag is not set for the owner**==
* Therefore the SetUID flag is ignored.
* The command will be executed with the effective rights of the owner and group.
1. **In Bash, `inserting 2>&1` after a command redirects:**
* standard error to standard input.
* standard input to standard error.
* ==**standard output to standard error.**==
* standard error to standard output.
* standard outputto standard input.
1. **What is the purpose of the Filesystem Hierarchy Standard?**
* It is a security model used to ensurefiles are organized according to their permissions and accessibility.
* It provides unified tools to create, maintain and manage multiple filesystems in a common way.
* It defines a common internal structure of inodes for all compliant filesystems.
* ==**It is a distribution neutral description of locations of files and directories.**==
1. **Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)**
* `chmod +s /tmp`
* ==**`chmod +t /tmp`**==
* ==**`chmod 1775 /tmp`**==
* `chmod 4775 /tmp`
* `chmod 2775 /tmp`
1. **Which of the following commands prints a list of available package updates when using RPM-based package management?**
* `dpkg list`
* `yum list`
* `dpkg check-update`
* ==`yum check-update`==
* `yum list-update`
1. **Which utility would be used to change how often a filesystem check is performed on an ext2 filesystem without losing any data stored on that filesystem?**
* `mod2fs`
* `fsck`
* ==**`tune2fs`**==
* `mke2fs`
* `fixe2fs`
1. **Which of the following Linux filesystems preallocates a fixed number of inodes at the filesystem's make/creation time and does NOT generate them as needed?**
**(Choose TWO correct answers.)**
* ==**`ext3`**==
* `JFS`
* ==**`ext2`**==
* `XFS`
* `procfs`
1. **Which command is used to query information about the available packages on a Debian system?**
* ==**`apt-cache`**==
* `apt-get`
* `apt-search`
* `dpkg`
* `dpkg-search`
1. **Which type of filesystem is created by mkfs when it is executed with the block device name only and without any additional parameters?**
* ==**`ext2`**==
* `ext3`
* `ext4`
* `XFS`
* `VFAT`
1. **Which SysV init configuration file is commonly used to set the default run level? (Specify the full name of the file, including path.)**
* ==**`inittab`**==
1. **Which command reads and displays the current contents of the Kernel Ring Buffer on the command line? (Specify ONLY the command without any path or parameters.)**
* ==**`dmesg`**==
1. **Which of the following commands will change the quota for a specific user?**
* ==**`edquota`**==
* `repquota`
* `quota -e`
* `quota`
1. **Which of the following command sets the Bash variable named TEST with the content `FOO`?**
* `set TEST="FOO"`
* `TEST = "FOO"`
* `var TEST="FOO"`
* ==**`TEST="FOO"`**==
1. **Which of the following commands makes `/bin/foo` executable by everyone but writable only by its owner?**
* ==**`chmod u=rwx,go=rx /bin/foo`**==
* `chmod o+rwx,a+rx /bin/foo`
* `chmod 577 /bin/foo`
* `chmod 775 /bin/foo`
1. **Where does the BIOS search for a bootloader?**
* On all connected storage media regardless of the boot device order.
* ==**On all connected storage media in the defined boot device order.**==
* Only on hard disk drives in the defined boot device order.
* Only on the last added storage media.
* The BIOS is not responsible to search for a valid bootloader.
1. **How can the list of files that would be installed by the RPM package file apache-xml.rpm be previewed?**
* `rpm –qp apache-xml.rpm`
* `rpm –qv apache-xml.rpm`
* `rpm –ql apache-xml.rpm`
* ==**`rpm –qpl apache-xml.rpm`**==
1. **When using regular expressions, which of the following characters match the beginning of a line?**
* ==**`^`**==
* `?`
* `*`
* `+`
* `$`
1. **Which of the following commands will mount an already inserted CD-ROM in `/dev/sr0` onto an existing directory `/mnt/cdrom` when issued with `root` privileges?**
* `mount /dev/cdrom /mnt/cdrom`
* `mount /dev/sr0 /mnt/cdrom`
* ==**`mount –t cdrom /dev/sr0 /mnt/cdrom`**==
* `mount –l cdrom /dev/sr0 /mnt/cdrom`
* `mount –f /dev/sr0/mnt/cdrom`
1. **Which of the following examples for Bash file globbing matches a file named `root-can-do-this.txt` when used in the directory holding that file? (Choose three correct answers.)**
* ==**`root*can?do-this.{txt,odt}`**==
* ==**`r[oOoO]t-can-do*.txt`**==
* ==**`{root,user,admin}-can-??-this.txt`**==
* `root*can*do??this.txt`
* `root***{can,may}-do-this.[tT][xX][tT]`
1. **When planning a partition scheme, which of the following directories could be considered for separate partitions? (Choose three.)**
* `/etc`
* ==**`/home`**==
* ==**`/var`**==
* `/lib`
* ==**`/opt`**==
1. **Which of the following describes the correct order in which the components of the system boot process are started?**
* BIOS, kernel, bootloader, init system
* ==**BIOS, bootloader,kernel, init system**==
* Bootloader, BIOS, kernel, init system
* BIOS, bootloader, init system, kernel
* Bootloader, BIOS, init system, kernel
1. **Which signal is sent by the kill command by default?**
* SIGHUP(1)
* SIGQUIT(3)
* SIGKILL(9)
* ==SIGTERM(15)==
1. **Which program updates the database that is used by the locate command?**
* ==**`updatedb`**==
1. **Which of the following commands can be used to create a new file that is 100kB in size?**
* ==**`dd`**==
* `file`
* `mkfile`
* `touch`
1. **How is a symbolic link called bar.conf pointing to foo.conf created?**
* ==**`ln –s foo.conf bar.conf`**==
* `ln foo.conf bar.conf`
* `ln –s bar.conf foo.conf`
* `ln bar.conffoo.conf`
1. **Which of the following is true for hard linked files? (Choose three.)**
* The output ofstatwill reporthardinstead ofregular file.
* ==**The hard linked files have the same permissions and owner.**==
* ==**The hard linked files share the same inode.**==
* The hard linked files are indicated by a `->` when listed with `ls -1`.
* ==**The hard linked files must be on the same filesystem.**==
1. **Which of the following are filesystems which can be used on Linux root partitions? (Choose two.)**
* `NTFS`
* ==**`ext3`**==
* `XFS`
* `VFAT`
* ==**`swap`**==
1. **Pressing the `Ctrl-C` combination on the keyboard while a command is executing in the foreground sends which of the following signal codes?**
* `1 (SIGHUP)`
* ==**`2 (SIGINT)`**==
* `3 (SIGQUIT)`
* `9 (SIGKILL)`
* `15 (SIGTERM)`
1. **Which of the following commands can be used to display the inode number of a given file?**
* `inode`
* ==**`ls`**==
* `ln`
* `cp`
1. **Which of the following commands shows the definition of a given shell command?**
* `where`
* `stat`
* ==**`type`**==
* `case`
1. **Which of the following `apt-get` commands will install the newest versions of all currently installed packages?**
* `auto-update`
* `full-upgrade`
* ==**`dist-upgrade`**==
* `install`
* update
1. **Which of the following are modes of the `vi` editor? (Choose two.)**
* `edit mode`
* ==`insert mode`==
* `change mode`
* `review mode`
* ==**`command mode`**==
1. **Which file in `/proc` describes the IRQs that are used by various kernel drivers? (Specify the file name only without any path.)**
* ==**`interrupts`**==
1. **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?**
* The kernel has not finished flushing disk writes to themounted device.
* ==**A user has a file open in the `/mnt` directory.**==
* Another file system still contains a symlink to a file inside `/mnt`.
* The files in `/mnt` have been scanned and added to the locate database.
* The kernel thinks that a process is about toopen a file in `/mnt` for reading.
1. **Which file from the `/proc` file system contains a list of all currently mounted devices? (Specify ONLY the command without any path or parameters.)**
* ==**`mounts`**==
1. **What command changes the nice level of a running process? (Specify ONLY the command without any path or parameters)**
* ==**`renice`**==
1. **Which of the following commands creates an ext3 filesystem on `/dev/sdb1`? (Choose TWO correct answers.)**
* ==**`/sbin/mke2fs -j /dev/sdb1`**==
* ==**`/sbin/mkfs -t ext3 /dev/sdb1`**==
* `/sbin/mkfs -c ext3 /dev/sdb1`
* `/sbin/mke3fs -j /dev/sdb1`
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 check while booting?**
* `tune2fs -d 200 /dev/sda1`
* `tune2fs -c 200 /dev/sda1`
* ==**`tune2fs -i 200 /dev/sda1`**==
* `tune2fs -n 200 /dev/sda1`
* `tune2fs --days 200 /dev/sda1`
1. **When considering the use of hard links, what are valid reasons not to use hard links?**
* ==**Hard links are not available on all Linux systems because traditional filesystems, such as ext4, do not support them**==
* Each hard link has individual ownership, permissions and ACLs which can lead to unintended disclosure of file content
* Hard links are specific to one filesystem and cannot point to files on another filesystem
* If users other than root should be able to create hard links, suln has to be installed and configured
* When a hard linked file is changed, a copy of the file is created and consumes additional space
1. **Consider the following directory:**
**`drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales`**
**Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)**
* `chmod g+s sales`
* `setpol –R newgroup=sales sales`
* ==**`chgrp –p sales sales`**==
* `chown --persistent *.sales sales`
* ==**`chmod 2775 sales`**==
1. **What is true regarding UEFI firmware? (Choose two.)**
* It can read and interpret partition tables
* ==**It can use and read certain file systems**==
* It stores its entire configuration on the `/boot/` partition
* ==**It is stored in a special area within the GPT metadata**==
* It is loaded from a fixed boot disk position
1. **Which of the following are valid stream redirection operators within Bash? (Choose two.)**
* ==**`<`**==
* ==**`<<<`**==
* `%>`
* `>>>`
* ==**`>`**==
1. **Which program runs a command in specific intervals and refreshes the display of the program’s output? (Specify ONLY the command without any path or parameters.)**
* ==**`watch`**==
1. **A faulty kernel module is causing issues with a network interface card. Which of the following actions ensures that this module is not loaded automatically when the system boots?**
* Using `lsmod --remove --autoclean` without specifying the name of a specific module
* Using `modinfo –k` followed by the name of the offending module
* Using `modprobe –r` followed by the name of the offending module
* ==**Adding a blacklist line including the name of the offending module to the file `/etc/modprobe.d/blacklist.conf`**==
* Deleting the kernel module’s directory from the file system and recompiling the kernel, including its modules
1. **Which of the following commands installs GRUB 2 into the master boot record on the third hard disk?**
* `grub2 install /dev/sdc`
* `grub-mkrescue /dev/sdc`
* `grub-mbrinstall /dev/sdc`
* `grub-setup /dev/sdc`
* ==**`grub-install /dev/sdc`**==
1. **Which of the following statements are true about the boot sequence of a PC using a BIOS? (Choose two.)**
* ==**Some parts of the boot process can be configured from the BIOS**==
* Linux does not require the assistance of the BIOS to boot a computer
* The BIOS boot process starts only if secondary storage, such as the hard disk, is functional
* ==**The BIOS initiates the boot process after turning the computer on**==
* The BIOS is started by loading hardware drivers from secondary storage, such as the hard disk
1. **Which of the following files, located in a user home directory, contains the Bash history?**
* `.bashrc_history`
* `.bash_histfile`
* `.history`
* ==**`.bash_history`**==
* `.history_bash`
1. **Which of the following commands list all files and directories within the `/tmp/` directory and its subdirectories which are owned by the user root? (Choose two.)**
* ==**`find /tmp –user root -print`**==
* `find –path /tmp –uid root`
* `find /tmp –uid root -print`
* ==**`find /tmp –user root`**==
* `find –path /tmp –user root -print`
1. **What does the command mount `--bind` do?**
* ==**It makes the contents of one directory available in another directory**==
* It mounts all available filesystems to the current directory
* It mounts all user mountable filesystems to the user’s home directory
* It mounts all file systems listed in `/etc/fstab` which have the option userbind set
* It permanently mounts a regular file to a directory
1. **Which of the following commands redirects the output of ls to standard error?**
* `ls >-1`
* `ls <<ERR`
* ==**`ls >&2`**==
* `ls >>2`
* `ls |error`
1. **Which command uninstalls a package but keeps its configuration files in case the package is re-installed?**
* `dpkg –s pkgname`
* `dpkg –L pkgname`
* `dpkg –P pkgname`
* `dpkg –v pkgname`
* ==**`dpkg –r pkgname`**==
1. **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?**
* `:r`
* `:n`
* `:w`
* ==**`:e`**==
1. **Which daemon handles power management events on a Linux system?**
* ==**`acpid`**==
* `batteryd`
* `pwrmgntd`
* `psd`
* `inetd`
1. **Which Bash environment variable defines in which file the user history is stored when exiting a Bash process? (Specify ONLY the variable name.)**
* ==**`HISTFILE`**==
1. **When in Normal mode in `vi`, which character can be used to begin a reverse search of the text?**
* ==**`?`**==
* `/`
* `F`
* `r`
1. **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?**
* Start in `runlevel 1`.
* ==**Pass `init=/bin/sh` on the kernel parameter line.**==
* Pass `/bin/sh` on the kernel parameter line.
* Pass `start=/bin/sh` on the kernel parameter line.
1. **Which of the following commands reboots the system when using SysV init? (Choose TWO correct answers.)**
* ==**`shutdown -r now`**==
* `shutdown -r "rebooting"`
* ==**`telinit 6`**==
* `telinit 0`
* `shutdown -k now "rebooting"`
1. **You suspect that a new ethernet card might be conflicting with another device. Which file should you check within the /proc tree to learn which IRQs are being used by which kernel drivers?**
* ==**`interrupts`**==, ==**`/proc/interrupts`**==
1. **Which SysV init configuration file should be modified to disable the ctrl-alt-delete key combination?**
* `/etc/keys`
* `/proc/keys`
* ==**`/etc/inittab`**==
* `/proc/inittab`
* `/etc/reboot`
1. **Which of the following kernel parameters instructs the kernel to suppress most boot messages?**
* silent
* verbose=0
* nomesg
* ==quiet==
1. **What is the name of the main configuration file for GNU GRUB? (Specify the file name only without any path.)**
* ==**`menu.lst`**==, ==**`grub.conf`**==, ==**`grub.cfg`**==
1. **Which Debian package management tool asks the configuration questions for a specific already installed package just as if the package were being installed for the first time? (Specify ONLY the command without any path or parameters.)**
* ==**`dpkg-reconfigure`**==
1. **After modifying GNU GRUB's configuration file, which command must be run for the changes to take effect?**
* `kill -HUP $(pidof grub)`
* `grub-install`
* `grub`
* ==**No action is required**==
1. **Which file should be edited to select the network locations from which Debian installation package files are loaded?**
* `/etc/dpkg/dpkg.cfg`
* `/etc/apt/apt.conf`
* `/etc/apt/apt.conf.d`
* ==**`/etc/apt/sources.list`**==
* `/etc/dpkg/dselect.cfg`
1. **Which of the following `apt-get` commands will install the newest versions of all currently installed packages without removing any packages or installing new packages that are not already installed?**
* `auto-update`
* ==**`upgrade`**==
* `dist-upgrade`
* `install`
* `update`
1. **Which of the following commands can be used to determine how long the system has been running? (Choose TWO correct answers.)**
* ==**`uptime`**==
* `up`
* ==**`top`**==
* `uname -`u
* `time –up`
1. **When given the following command line.
`echo "foo bar" | tee bar | cat`
Which of the following output is created?**
* `cat`
* ==**`foo bar`**==
* `tee bar`
* `bar`
* `foo`
1. **Which of the following commands will print the last 10 lines of a text file to the standard output?**
* `cat -n 10 filename`
* `dump -n 10 filename`
* `head -n 10 filename`
* ==**`tail -n 10 filename`**==
1. **Which of the following commands will send output from the program myapp to both standard output (stdout) and the file `file1.log`?**
* `cat < myapp | cat > file1.log`
* `myapp 0>&1 | cat > file1.log`
* `myapp | cat > file1.log`
* ==**`myapp | tee file1.log`**==
* `tee myapp file1.log`
1. **In compliance with the FHS, in which of the directories are `man` pages found?**
* ==**`/usr/share/man`**==
* `/opt/man`
* `/usr/doc/`
* `/var/pkg/man`
1. **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?**
* `-dirmax`
* ==**`-maxdepth`**==
* `-maxlevels`
* `-n`
* `-s`
1. **What is the purpose of the Bash built-in `export` command?**
* It allows disks to be mounted remotely.
* It runs a command as a process in a subshell.
* It makes the command history available to subshells.
* ==**It sets up environment variables for applications.**==
* It shares NFS partitions for use by other systems on the network.
1. **When starting a program with the nice command without any additional parameters, which nice level is set for the resulting process?**
* `-10`
* `10`
* ==**`20`**==
1. **What does the `+` symbol mean in the following `grep` regular expression:**
**`grep '^d[aei]\+d$' /usr/share/dict/words`**
* ==**Match the preceding character set `([aei])` one or more times.**==
* Match the preceding character set `([aei])` zero or more times.`
* Match the preceding character set `([aei])` zero or one times.
* Match a literal `+` symbol
1. **Which character, added to the end of a command, runs that command in the background as a child process of the current shell?**
* `!`
* `+`
* ==**`&`**==
* `%`
* `#`
1. **Which of the following commands is used to change metadata and options for ext3 filesystems?**
* `mod3fs`
* `tune3fs`
* `mod2fs`
* ==**`tune2fs`**==
* `dump2fs`
1. **After moving data to a new filesystem, how can the former path of the data be kept intact in order to avoid reconfiguration of existing applications? (Choose TWO correct answers.)**
* By creating an ACL redirection from the old to the new path of the data.
* By creatinga hard link from the old to the new path of the data.
* ==**By creating a symbolic link from the old to the new path of the data.**==
* By running the command touch on the old path.
* ==**By mounting the new filesystem on the original path of the data.**==
1. **Which of the following statements is correct for a command line ending with a `&` character?**
* The command’s output is redirected to `/dev/null`.
* The result of the command defines if the next command will be run.
* ==**The command is run in background of the current shell.**==
* The command is run as a direct child of theinitprocess.
1. **Which of the following commands changes the ownership of `file.txt` to the user `dan` and the group `staff`?**
* `chown dan/staff file.txt`
* ==**`chown dan:staff file.txt`**==
* `chown -u dan -g staff file.txt`
* `chown dan -g staff file.txt`
1. **Which of the following is a limitation of the `cut` command?**
* The `cut` command can only select output by field position.
* ==**The `cut` command cannot reorder fields.**==
* The `cut` command only works on ASCIItext.
* The `cut` command cannot use different input and output delimiters.
1. **Which of the following options must be passed to a filesystem’s entry in /etc/fstab in order to mount the file system without root privileges?**
* `auto`
* `norestrict`
* `noauto`
* ==**`user`**==
1. **What is the process ID number of the init process on a SysV init based system?**
* `-1`
* ==**`1`**==
* It is different with each reboot.
* It is set to the current run level.
1. **What is the purpose of the `xargs` command?**
* It passes arguments to an X server.
* ==**It reads standard input (STDIN) and builds up command lines to execute.**==
* It helps shellscripts take variable argument lists.
* It asks a question, graphically, and returns the answer to the shell.
* It allows users to specify long options for commands that normally only accept short options.
1. **Which of the following partition types is used for Linux swap spaces when partitioning hard disk drives?**
* `82`
* ==**`83`**==
* `8e`
* `fd`
* `7`
1. **Which command is used to start another command with a given nice level? (Specify ONLY the command without any path or parameters.)**
* ==**`nice`**==
1. **The system configuration file named ______ is commonly used to set the default runlevel. (Please provide the file name with full path information)**
* ==**`/etc/inittab`**==
1. **Instead of supplying an explicit device in `/etc/fstab` for mounting, what other options may be used to identify the intended partition? (Choose TWO correct answers.)**
* `FIND`
* `ID`
* ==**`LABEL`**==
* `NAME`
* ==**`UUID`**==
1. **Which of the following pieces of information of an existing file is changed when a hard link pointing to that file is created?**
* File size
* Modify timestamp
* ==**Link count**==
* Inode number
* Permissions
1. **In compliance with the FHS, in which of the following directories are documentation files found?**
* `/usr/share/documentation`
* `/usr/local/share/documentation`
* ==**`/var/share/doc`**==
* `/usr/share/doc`
* `/etc/share/doc`
1. **When piping the output of find to the xargs command, what option to find is useful if the filenames have spaces in them?**
* `–rep-space`
* ==**`–print0`**==
* `–nospace`
* `–ignore-space`
1. **Which command will uninstall a package but leave its configuration files in case the package is re-installed?**
* `dpkg –s pkgname`
* `dpkg –L pkgname`
* `dpkg –P pkgname`
* ==**`dpkg –r pkgname`**==
1. **Which option to the `tee` command will cause the output to be concatenated on the end of the output file instead of overwriting the existing file contents?**
* ==**`–a`**==
* `–c`
* `--no-clobber`
* `--continue`
1. **Which of the following commands will display the inode usage of each mounted filesystem?**
* `du –i`
* ==**`df –i`**==
* `lsfs –i`
* `printfs –i`
1. **Which of the following commands updates the already installed RPM package rpmname?**
* `rpm --update rpmname`
* ==**`rpm –U rpmname`**==
* `rpm –q rpmname`
* `rpm --force rpmname`
* `rpm –u rpmname`
1. **Which of the following file permissions belong to a symbolic link?**
* `-rwxrwxrwx`
* `+rwxrwxrwx`
* ==**`lrwxrwxrwx`**==
* `srwxrwxrwx`
1. **Which of the following is the device file name for the second partition on the only SCSI drive?**
* `/dev/hda1`
* ==**`/dev/sda2`**==
* `/dev/sd0a2`
* `/dev/sd1p2`
1. **Which of the following commands displays the path to the executable file that would be executed when the command `foo` is invoked?**
* `lsattr foo`
* `apropos foo`
* `locate foo`
* `whatis foo`
* ==**`which foo`**==
1. **Which of the following directories on a 64 bit Linux system typically contain shared libraries? (Choose two.)**
* `~/.lib64/`
* ==**``/usr/lib64/``**==
* `/var/lib64/`
* ==**`/lib64/`**==
* `/opt/lib64/`
1. **Which of the following properties of a Linux system should be changed when a virtual machine is cloned? (Choose two.)**
* The partitioning scheme
* The file system
* The D-Bus Machine ID
* ==**The permissions of `/root/`**==
* ==**The SSH host keys**==
1. **Which of the following commands lists the dependencies of the RPM package file foo.rpm?**
* ==**`rpm –qpR foo.rpm`**==
* `rpm –dep foo`
* `rpm –ld foo.rpm`
* `rpm –R foo.rpm`
* `rpm –pD foo`
1. **What is contained on the EFI System Partition?**
* The Linux root file system
* ==**The first stage boot loader**==
* The default swap space file
* The Linux default shell binaries
* The user home directories
1. **A Debian package creates several files during its installation. Which of the following commands searches for packages owning the file `/etc/debian_version`?**
* `apt-get search /etc/debian_version`
* `apt –r /etc/debian_version`
* `find /etc/debian_version -dpkg`
* ==**`dpkg –S /etc/debian_version`**==
* `apt-file /etc/debian_version`
1. **What is the first program the Linux kernel starts at boot time when using System V init?**
* `/lib/init.so`
* `/proc/sys/kernel/init`
* `/etc/rc.d/rcinit`
* ==**`/sbin/init`**==
* `/boot/init`
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 and are not accessible at all for everyone else?**
* `0750`
* ==**`0027`**==
* `0036`
* `7640`
* `0029`
1. **Which of the following `vi` commands deletes two lines, the current and the following line?**
* `d2`
* `2d`
* ==**`2dd`**==
* `dd2`
* `de12`
1. **Given the following input stream:**
```shell
txt1.txt
atxt.txt
txtB.txt
```
**Which of the following regular expressions turns this input stream into the following output stream?**
```shell
txt1.bak.txt
atxt.bak.txt
txtB.bak.txt
```
```shell
txt1.bak.txt atxt.bak.txt txtB.bak.txt
```
* `s/^.txt/.bak/`
* ==**`s/txt/bak.txt/`**==
* `s/txt$/bak.txt/`
* `s/^txt$/.bak^/`
* `s/[.txt]/.bak$1/`
1. **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`?**
* `foo | less /tmp/foodata`
* `foo | cp /tmp/foodata`
* `foo > /tmp/foodata`
* ==**`foo | tee /tmp/foodata`**==
* `foo > stdout >> /tmp/foodata`
1. **During a system boot cycle, what program is executed after the BIOS completes its tasks?**
* ==**The bootloader**==
* The inetd program
* The init program
* The kernel
1. **You are having some trouble with a disk partition and you need to do maintenance on this partition but your users home directories are on it and several are logged in. Which command would disconnect the users and allow you to safely execute maintenance tasks?**
* ==**`telinit 1`**==
* `shutdown -r now`
* `killall -9 inetd`
* `/bin/netstop --maint`
* `/etc/rc.d/init.d/network stop`
1. **Which of the following commands will write a message to the terminals of all logged in users?**
* `bcast`
* `mesg`
* `print`
* ==`wall`==
* `yell`
*
1. **The USB device filesystem can be found under /proc/______/usb/. (Please fill in the blank with the single word only)**
* ==**`bus`**==
1. **The message "Hard Disk Error" is displayed on the screen during Stage 1 of the GRUB boot process. What does this indicate?**
* The kernel was unable to execute `/bin/init`
* ==**The next Stage cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk**==
* One or more of the filesystems on the hard disk has errors and a filesystem check should be run
* The BIOS was unable to read the necessary data from the Master Boot Record to begin the boot process
1. **Which run levels should never be declared as the default run level when using SysV init? (Choose TWO correct answers.)**
* ==**`0`**==
* `1`
* `3`
* `5`
* ==**`6`**==
1. **Which file in the `/proc` filesystem lists parameters passed from the bootloader to the kernel? (Specify the file name only without any path.)**
* ==**`cmdline`**==, ==**`/proc/cmdline`**==
1. **What is the default nice level when a process is started using the `nice` command?**
* `-10`
* ==**`0`**==
* `20`
* `15`
* `10`
1. **What of the following statements are true regarding `/dev/` when using `udev`? (Choose TWO correct answers.)**
* Entries for all possible devices get created on boot even if those devices are not connected.
* ==**Additional rules for `udev` can be created by adding them to `/etc/udev/rules.d/`**==.
* When using `udev`, it is not possible to create block orcharacter devices in `/dev/` using mknod.
* ==**The `/dev/` directory is a filesystem of type `tmpfs` and is mounted by `udev` during system startup.**==
* The content of `/dev/` is stored in `/etc/udev/dev` and is restored during system startup.
1. **Which option to the `yum` command will update the entire system? (Specify ONLY the option name without any additional parameters.)**
* ==**`update`**==
1. **To prevent users from being able to fill up the `/` partition, the ______ directory should be on a separate partition if possible because it is world writeable.**
* ==**`/tmp`**==
1. **When removing a package, which of the following `dpkg` options will completely remove the files including configuration files?**
* `--clean`
* `--delete`
* ==**`--purge`**==
* `–remove`
1. **When using `rpm --verify` to check files created during the installation of RPM packages, which of the following information is taken into consideration? (Choose THREE correct answers.)**
* ==**Timestamps**==
* ==**MD5 checksums**==
* Inodes
* ==**File sizes**==
* GnuPG signatures
1. **Which of the following commands can be used to perform a full text search on all available packages on a Debian system?**
* `apt`
* ==**`apt-cache`**==
* `apt-get`
* `apt-search`
* `dpkg`
1. **You want to preview where the package file, `apache-xml.i386.rpm`, will install its files before installing it. What command do you issue?**
* `rpm -qp apache-xml.i386.rpm`
* `rpm -qv apache-xml.i386.rpm`
* `rpm -ql apache-xml.i386.rpm`
* ==**`rpm -qpl apache-xml.i386.rpm`**==
1. **Which of the following commands can be used to download the RPM package kernel without installing it?**
* `yum download --no-install kernel`
* ==**`yumdownloader kernel`**==
* `rpm --download --package kernel`
* `rpmdownload kernel`
1. **Which of the following commands updates the linker cache of shared libraries?**
* `mkcache`
* `soconfig`
* `mkldconfig`
* `lddconfig`
* ==**`ldconfig`**==
1. **What happens after issuing the command `vi` without any additional parameters?**
* `vi` starts and loads the last file used andmoves the cursor to the position where vi was when it last exited.
* `vi` starts and requires the user to explicitly either create a new or load an existing file.
* `vi` exits with an error message as it cannot be invoked without a file name to operate on.
* ==`vi` starts in command mode and opens a new empty file.==
* `vi` starts and opens a new file which is filled with the content of the vi buffer if the buffer contains text.
1. **The /etc/____ file lists currently mounted devices.**
* ==**`mtab`**==
1. **Which variable defines the directories in which a Bash shell searches for executable commands?**
* `BASHEXEC`
* `BASHRC`
* ==`PATH`==
* `EXECPATH`
* `PATHRC`
1. **What does the `?` symbol within regular expressions represent?**
* Match the preceding qualifier one or more times.
* Match the preceding qualifier zero or more times.
* ==**Match the preceding qualifier zero or one times.**==
* Match a literal `?` character.
1. **Which of the following commands moves and resumes in the background the last stopped shell job?**
* `run`
* ==**`bg`**==
* `fg`
* `back`
1. **Which of the following shell redirections will write standard output and standard error output to a file named `filename`?**
* `2>&1 >filename`
* ==**`>filename 2>&1`**==
* `1>&2>filename`
* `>>filename`
* `1&2>filename`
1. **Which of the following explanations are valid reasons to run a command in the background of your shell?**
* The command does not need to execute immediately.
* ==**The command has to run immediately but the user needs to log out.**==
* The system is being shut down and the command needs to restart execution immediately after the reboot.
* The command can run at a lower priority than normal commands run on the command line.
1. **Immediately after deleting 3 lines of text in vi and moving the cursor to a different line, which single character command will insert the deleted content below the current line?**
* `i` (lowercase)
* `P` (uppercase)
* ==**`p`** (lowercase)==
* `U` (uppercase)
* `u` (lowercase)
1. **From a Bash shell, which of the following commands directly executes the instruction from the file `/usr/local/bin/runme.sh` without starting a subshell? (Please select TWO answers.)**
* ==**`source /usr/local/bin/runme.sh`**==
* ==**`. /usr/local/bin/runme.sh`**==
* `/bin/bash /usr/local/bin/runme.sh`
* `/usr/local/bin/runme.sh`
* `run /usr/local/bin/runme.sh`
1. **Which `umask` value will result in the default access permissions of 600 (rw-------) for files and 700 (rwx------) for directories? (Specify only the numerical umask value.)**
* ==**`0077`**==, ==**`077`**==
1. **Which of the following statements describes a difference between GNU GRUB Legacy and GRUB 2?**
* GRUB 2 no longer requires a configuration file.
* ==**Partition numbers start at 0 in GRUB Legacy and 1 in GRUB 2.**==
* grub-mkconfigonly works with GRUB Legacy if the--version 1option is used.
* The configuration filemenu.lst(andgrub.conf) have been replaced withgrub.config.
1. **Which of the following settings for umask ensures that new files have the default permissions -rw-r----- ?**
* `0017`
* `0640`
* `0038`
* ==**`0027`**==
1. **Creating a hard link to an ordinary file returns an error. What could be the reason for this?**
* The source file is hidden.
* The source file is read-only.
* The source file is a shell script.
* The source file is already a hard link.
* ==**The source and the target are on different filesystems.**==
1. **Which of the following commands print the current working directory when using a Bash shell? (Choose two.)**
* ==**`echo “${PWD}”`**==
* `echo “${WD}”`
* ==**`pwd`**==
* `printwd`
* `echo “${pwd}”`
1. **Which command shows all shared libraries required by a binary executable or another shared library? (Specify ONLY the command without any path or parameters.)**
* ==**`ldd`**==
1. **Which of the following regular expressions represents a single upper-case letter?**
* `:UPPER:`
* ==**`[A-Z]`**==
* `!a-z`
* `%C`
* `{AZ}`
1. **When redirecting the output of find to the xargs command, what option to find is useful if the filenames contain spaces?**
* `–rep-space`
* `-printnul`
* `-nospace`
* `–ignore-space`
* ==`**–print0`**==
1. **Consider the following output from the command `ls –i`:**
```
525385 -rw-rw-r-- 2 1000 1000 0 Feb 12 19:44 a.txt
526255 lrwxrwxrxw 1 1000 1000 5 Feb 12 19:44 b.txt -> a.txt
```
**How would a new file named c.txt be created with the same inode number as a.txt (Inode 525385)?**
* `ln –h a.txt c.txt`
* `ln c.txt a.txt`
* ==**`ln a.txt c.txt`**==
* `ln –f c.txt a.txt`
* `ln –i 525385 c.txt`
1. **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 between 8:00 am and 8:59 am?**
* `grep –E ‘:08:[09]+:[09]+’ loga.log`
* `grep –E ‘:08:[00]+’ loga.log`
* `grep –E loga.log ‘:08:[0-9]+:[0-9]+’`
* `grep loga.log ‘:08:[0-9]:[0-9]’`
* ==**`grep –E ‘:08:[0-9]+:[0-9]+’ loga.log`**==
1. **Which of the following files exist in a standard GRUB 2 installation? (Choose two.)**
* `/boot/grub/stages/stage0`
* ==`/boot/grub/i386-pc/lvm.mod`==
* `/boot/grub/fstab`
* ==**`/boot/grub/grub.cfg`**==
* `/boot/grub/linux/vmlinuz`
1. **Which of the following commands redirects the output of ls to standard error?**
* `ls >-1`
* `ls <<ERR`
* ==**`ls >&2`**==
* `ls >>2`
* `ls |error`
1. **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?**
* `job –b dmaint`
* `dbmaint &>/dev/pts/null`
* ==**`nohup dbmaint &`**==
* `bg dbmaint`
* `wait dbmaint`
1. **Which of the following commands installs all packages with a name ending with the string foo?**
* `zypper get “*foo”`
* `zypper update “foo?”`
* `zypper force “foo*”`
* ==**`zypper install “*foo”`**==
* `zypper add “.*foo”`
1. **Which of the following commands will NOT update the modify timestamp on the file `/tmp/myfile.txt`?**
* ==**`file /tmp/myfile.txt`**==
* `echo "Hello" >/tmp/myfile.txt`
* `sed -ie "s/1/2/" /tmp/myfile.txt`
* `echo -n "Hello" >>/tmp/myfile.txt`
* `touch/tmp/myfile.txt`
1. **What is true regarding the command
`ls > files`
if `files` does not exist?**
* The output of ls is printed to the terminal
* ==**`files` is created and contains the output of `ls`**==
* An error message is shown and `ls` is not executed`
* The command `files` is executed and receives the output of `ls`
* Any output of `ls` is discarded
1. **Which of the following commands can be used to search for the executable file foo when it has been placed in a directory not included in `$PATH`?**
* `apropos`
* `which`
* ==**`find`**==
* `query`
* `whereis`
1. **How many fields are in a syntactically correct line of `/etc/fstab`?**
* `3`
* `4`
* `5`
* ==**`6`**==
* `7`
1. **What is the difference between the `i` and `a` commands of the `vi` editor?**
* `i` (interactive) requires the user to explicitly switch between vi modes whereas `a` (automatic) switches modesautomatically.
* ==**`i` (insert) inserts text before the current cursor position whereas `a` (append) inserts text after the cursor.**==
* `i` (independent rows) starts every new line at the first character whereas `a` (aligned rows) keeps the indentation of the previous line.
* `i` (interrupt) temporarily suspends editing of a file to the background whereas `a` (abort) terminates editing.
1. **Which of the following information is stored within the BIOS? (Choose TWO correct answers.)**
* ==**Boot device order**==
* Linux kernel version
* Timezone
* ==**Hardware configuration**==
* The system's hostname
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?**
* `systemd` ignores any manual mounts which are not done using the `systemctl mount` command
* ==**The command `systemctl mountsync` can be used to create a mount unit based on the existing mount**==
* `systemd` automatically generates a mount unit and monitors the mount point without changing it
* Unless a `systemd mount` unit is created, `systemd unmounts` the file system after a short period of time
* `systemctl unmount` must be used to remove the mount because system opens a file descriptor on the mount point
1. **When is the content of the kernel ring buffer reset? (Choose two.)**
* ==**When the ring buffer is explicitly reset using the command `dmesg --clear`**==
* When the ring buffer is read using dmesg without any additional parameters
* When a configurable amount of time, 15 minutes by default, has passed
* When the kernel loads a previously unloaded kernel module
* ==**When the system is shut down or rebooted**==
1. **Which wildcards will match the following filenames?**
```shell
ttyS0
ttyS1
ttyS2
```
* `ttyS[1-5]`
* ==**`tty?[0-5]`**==
* `tty*2`
* ==**`tty[A-Z][012]`**==
* `tty[Ss][02]`
1. **Which command must be entered before exiting `vi` to save the current file as `filea.txt`?**
* `%s filea.txt`
* `%w filea.txt`
* `:save filea.txt`
* ==**`:w filea.txt`**==
* `:s filea.txt`
1. **Which of the following files are found in the `/boot/ `file system? (Choose two.)**
* ==**Linux kernel images**==
* Bash shell binaries
* systemd target and service units
* ==**Initial ramdisk images**==
* fsck binaries
1. **The installation of a local Debian package failed due to unsatisfied dependencies. Which of the following commands installs missing dependencies and completes the interrupted package installation?**
* `dpkg --fix --all`
*` apt-get autoinstall`
* `dpkg-reconfigure --all`
* `apt-get all`
* ==**`apt-get install -f`**==
1. **When in Normal mode in vi, which character can be used to begin a reverse search of the text?**
* `r`
* `/`
* `F`
* ==**`?`**==
* `s`
1. **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 cause of the problem?**
* Using the `dmesg` command from the rescue CD’s shell to view the original system’s boot logs.
* Investigating the file `/proc/kmsg` on the computer’s hard disk for possible errors.
* ==**Investigating the file `/var/log` on the computer’s hard disk for possible errors.**==
* Using `chroot` to switch to the file system on the hard disk and use `dmesg` to view the logs.
* Rebooting again from the hard drive since the system successfully booted from the rescue CD.
1. **Which of the following commands will load a kernel module along with any required dependency modules?**
* `depmod`
* `insmod`
* ==**`modprobe`**==
* `module_install`
* `loadmod`
1. **What do the permissions `-rwSr-xr-x` mean for a binary file when it is ejecuted as a command?**
* The command is `SetUID` and it will be ejecuted with the effective rights of the owner
* The command will be executed with the efective rights of the group instead of the owner
* ==**The executed flag is not set for the owner. Therefore the `SetUID` flag is ignored**==
* The command will be executed with the efective rights of the owner and group
1. **What is the first program that is usually started, at boot time, by the Linux kernel when using SysV init?**
* `/lib/init.so`
* ==**`/sbin/init`**==
* `/etc/rc.d/rcinit`
* `/proc/sys/kernel/init`
* `/boot/init`
1. **Which of the following sequences in the `vi` editor saves the opened document and exits the editor?**
* ==**`esc ZZ`**==
* `ctrl :w!`
* `esc zz`
* ==**`esc :wq!`**==
* `ctrl XX`
1. **Which of the following commands will change all `CR-LF` pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt?**
* `tr '\r\n' '' < userlist.txt > newlist.txt`
* `tr –c '\n\r' '' < newlist.txt > userlist.txt`
* ==**`tr –d '\r' < userlist.txt > newlist.txt`**==
* `tr '\r' '\n' userlist.txt newlist.txt`
* `tr –s '^M' '^J' userlist.txt newlist.txt`
1. **Which of the following shell commands makes the already defined variable TEST visible to new child processes? (Choose two.)**
* `visible TEST`
* `export Cv TEST`
* `declare +x TEST`
* ==**`declare Cx TEST`**==
* ==**`export TEST`**==
1. **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`**==
1. **Which of the following is correct when talking about mount points?**
* ==**Every existing directory can be used as a mount point.**==
* Only empty directories can be used as a mount point.
* Directories need to have the SetUID flag set to be used as a mount point.
* Files within a directory are deleted when the directory is used as a mount point.
1. **An administrator has issued the following command:**
**`grub-install --root-directory=/custom-grub /dev/sda`**
**In which directory will new configuration files be found? (Provide the full directory path only without the filename)**
* ==**`/custom-grub/boot/grub/`**==
1. **In order to display all currently mounted filesystems, which of the following commands could be used? (Choose TWO correct answers.)**
* ==cat /proc/self/mounts==
* `free`
* ==**`mount`**==
* `lsmounts`
* `cat /proc/filesystems`
1. **Which of the following commands will print important system information such as the kernel version and machine hardware architecture?**
* `sysinfo`
* ==**`uname`**==
* `lspci`
* `arch`
* `info`
1. **Which permissions and ownership should the file `/etc/passwd` have?**
* `-rw-------1 root root 531 Jun 5 22:45 /etc/passwd`
* ==**`-rw-r--r--1 root root 531 Jun 5 22:45 /etc/passwd`**==
* `-rw-r--r--1 11531 Jun 5 22:45 /etc/passwd`
* `-rw-------1 11531 Jun 5 22:45 /etc/passwd`
1. **What does the command `grub-install /dev/sda` do?**
* GRUB creates partitions on the device `/dev/sdato` be used with Linux.
* GRUB sets the default BIOS boot device to `/dev/sda`.
* ==**GRUB installs all required files and configures the boot loader on device `/dev/sda`.**==
* GRUB recompiles the Linux Kernel and installs it on the Master Boot Record of device `/dev/sda`.
1. **Which of the following commands are common Linux commands for file management? (Choose three correct answers.)**
* `copy`
* ==**`mv`**==
* `move`
* ==**`cp`**==
* ==**`mkdir`**==
1. **What output will be displayed when the user fred executes the following command?**
**`echo 'fred $USER'`**
* `fred fred`
* `fred /home/fred/`
* `'fred $USER'`
* ==**`fred $USER`**==
* `'fred fred'`
1. **Which of the following commands lists the dependencies of a given dpkg package?**
* `apt-cache depends-onpackage`
* `apt-cache dependencies package`
* ==**`apt-cache depends package`**==
* `apt-cache requires package`
1. **Which command creates a swap space on a block device or a file? (Specify ONLY the command without any path or parameters.)**
* ==**`mkswap`**==
1. **Which of the following commands converts spaces in a file to tab characters and prints the result to standard output?**
* `iconv`
* `expand`
* ==**`unexpand`**==
* `tab`
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?**
* XFS
* VFAT
* ==**ext2**==
* ext3
* ext4
1. **Which is the default percentage of reserved space for the root user on new ext4 filesystems?**
* 10%
* 3%
* 15%
* 0%
* ==**5%**==
1. **Which chown command changes the ownership to `dave` and the group to `staff` on a file named `data.txt`?**
* `chown dave/staff data.txt`
* `chown –u dave –g staff data.txt`
* `chown --user dave --group staff data.txt`
* `chown dave+staff data.txt`
* ==**`chown dave:staff data.txt`**==
1. **What does the command `mount -a` do?**
* It mounts all available filesystems onto the current directory.
* It shows all mounted filesystems.
* It mounts all user mountable filesystems for thecurrent user.
* ==**It mounts all filesystems listed in `/etc/fstab` which have the option auto set.**==
* It mounts all filesystems listed in `/etc/fstab` which have the option noauto set
1. **Which of the following commands enables the setuid (suid) permission on the executable `/bin/foo`?**
* `chmod 1755 /bin/foo`
* ==**`chmod 4755 /bin/foo`**==
* `chmod u-s /bin/foo`
* `chmod 755+s /bin/foo`