Exam4Training

Lpi 101-500 LPI Linux Administrator – 101 (LPIC-1 101) Online Training

Question #1

Topic 1, System Architecture

CORRECT TEXT

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)

Reveal Solution Hide Solution

Correct Answer: dmesg, /bin/dmesg
Question #2

Which of the following information is stored within the BIOS? (Choose TWO Answer s.)

  • A . Boot device order
  • B . Linux kernel version
  • C . Timezone
  • D . Hardware configuration
  • E . The system’s hostname

Reveal Solution Hide Solution

Correct Answer: A,D
Question #3

Which of the following options for the kernel’s command line changes the systemd boot target to rescue.target instead of the default target?

  • A . systemd.target=rescue.target
  • B . systemd.runlevel=rescue.target
  • C . systemd.service=rescue.target
  • D . systemd.default=rescue.target
  • E . systemd.unit=rescue.target

Reveal Solution Hide Solution

Correct Answer: E
Question #4

CORRECT TEXT

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?

Reveal Solution Hide Solution

Correct Answer: interrupts, /proc/interrupts
Question #5

CORRECT TEXT

Which file in the /proc filesystem lists parameters passed from the bootloader to the kernel? (Specify the file name only without any path.)

Reveal Solution Hide Solution

Correct Answer: cmdline, /proc/cmdline
Question #6

During a system boot cycle, what program is executed after the BIOS completes its tasks?

  • A . The bootloader
  • B . The inetd program
  • C . The init program
  • D . The kernel

Reveal Solution Hide Solution

Correct Answer: A
Question #7

What information can the lspci command display about the system hardware? (Choose THREE Answer s.)

  • A . Device IRQ settings
  • B . PCI bus speed
  • C . System battery type
  • D . Device vendor identification
  • E . Ethernet MAC address

Reveal Solution Hide Solution

Correct Answer: A,B,D
Question #8

During a system boot cycle, what is the program that is run after the BIOS completes its tasks?

  • A . The bootloader
  • B . The inetd program
  • C . The init program
  • D . The kernel

Reveal Solution Hide Solution

Correct Answer: A
Question #9

CORRECT TEXT

The USB device filesystem can be found under /proc/______/usb/. (Please fill in the blank with the single word only)

Reveal Solution Hide Solution

Correct Answer: bus
Question #10

The system is having trouble and the engineer wants to bypass the usual /sbin/init start up and run /bin/sh.

What is the usual way to pass this change to the kernel from your boot loader?

  • A . Start in runlevel 1.
  • B . Pass init=/bin/sh on the kernel parameter line.
  • C . Pass /bin/sh on the kernel parameter line.
  • D . Pass start=/bin/sh on the kernel parameter line.

Reveal Solution Hide Solution

Correct Answer: B

Question #11

What is the first program that is usually started, at boot time, by the Linux kernel when using SysV init?

  • A . /lib/init.so
  • B . /sbin/init
  • C . /etc/rc.d/rcinit
  • D . /proc/sys/kernel/init
  • E . /boot/init

Reveal Solution Hide Solution

Correct Answer: C
Question #12

Which of the following kernel parameters instructs the kernel to suppress most boot messages?

  • A . silent
  • B . verbose=0
  • C . nomesg
  • D . quiet

Reveal Solution Hide Solution

Correct Answer: D
Question #13

The message "Hard Disk Error" is displayed on the screen during Stage 1 of the GRUB boot process.

What does this indicate?

  • A . The kernel was unable to execute /bin/init
  • B . The next Stage cannot be read from the hard disk because GRUB was unable to determine the size and geometry of the disk
  • C . One or more of the filesystems on the hard disk has errors and a filesystem check should be run
  • D . The BIOS was unable to read the necessary data from the Master Boot Record to begin the boot process

Reveal Solution Hide Solution

Correct Answer: B
Question #14

Which of the following commands will write a message to the terminals of all logged in users?

  • A . bcast
  • B . mesg
  • C . print
  • D . wall
  • E . yell

Reveal Solution Hide Solution

Correct Answer: D
Question #15

CORRECT TEXT

Which command will display messages from the kernel that were output during the normal boot sequence?

Reveal Solution Hide Solution

Correct Answer: dmesg, /bin/dmesg
Question #16

Which SysV init configuration file should be modified to disable the ctrl-alt-delete key combination?

  • A . /etc/keys
  • B . /proc/keys
  • C . /etc/inittab
  • D . /proc/inittab
  • E . /etc/reboot

Reveal Solution Hide Solution

Correct Answer: C
Question #17

Which of the following commands reboots the system when using SysV init? (Choose TWO Answer s.)

  • A . shutdown -r now
  • B . shutdown -r "rebooting"
  • C . telinit 6
  • D . telinit 0
  • E . shutdown -k now "rebooting"

Reveal Solution Hide Solution

Correct Answer: A,C
Question #18

Which run levels should never be declared as the default run level when using SysV init? (Choose TWO Answer s.)

  • A . 0
  • B . 1
  • C . 3
  • D . 5
  • E . 6

Reveal Solution Hide Solution

Correct Answer: A,E
Question #19

Which of the following statements is correct when talking about /proc/?

  • A . All changes to files in /proc/ are stored in /etc/proc.d/ and restored on reboot.
  • B . All files within /proc/ are read-only and their contents cannot be changed.
  • C . All changes to files in /proc/ are immediately recognized by the kernel.
  • D . All files within /proc/ are only readable by the root user.

Reveal Solution Hide Solution

Correct Answer: C
Question #20

Which of the following are init systems used within Linux systems? (Choose THREE Answer s.)

  • A . startd
  • B . systemd
  • C . Upstart
  • D . SysInit
  • E . SysV init

Reveal Solution Hide Solution

Correct Answer: B,C,E

Question #21

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 Answer s.)

  • A . shutdown -R 1 now
  • B . shutdown -single now
  • C . init 1
  • D . telinit 1
  • E . runlevel 1

Reveal Solution Hide Solution

Correct Answer: C,D
Question #22

What of the following statements are true regarding /dev/ when using udev? (Choose TWO Answer s.)

  • A . Entries for all possible devices get created on boot even if those devices are not connected.
  • B . Additional rules for udev can be created by adding them to /etc/udev/rules.d/.
  • C . When using udev, it is not possible to create block orcharacter devices in /dev/ using mknod.
  • D . The /dev/ directory is a filesystem of type tmpfs and is mounted by udev during system startup.
  • E . The content of /dev/ is stored in /etc/udev/dev and is restored during system startup.

Reveal Solution Hide Solution

Correct Answer: B,D
Question #23

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?

  • A . telinit 1
  • B . shutdown -r now
  • C . killall -9 inetd
  • D . /bin/netstop –maint
  • E . /etc/rc.d/init.d/network stop

Reveal Solution Hide Solution

Correct Answer: A
Question #24

Topic 2, Linux Installation and Package Management

Which RPM command will output the name of the package which supplied the file /etc/exports?

  • A . rpm -F /etc/exports
  • B . rpm -qf /etc/exports
  • C . rpm -Kl /etc/exports
  • D . rpm -qp /etc/exports
  • E . rpm -qi/etc/exports

Reveal Solution Hide Solution

Correct Answer: B
Question #25

CORRECT TEXT

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.)

Reveal Solution Hide Solution

Correct Answer: dpkg-reconfigure
Question #26

Which of the following options is used in a GRUB Legacy configuration file to define the amount of time that the GRUB menu will be shown to the user?

  • A . hidemenu
  • B . splash
  • C . timeout
  • D . showmenu

Reveal Solution Hide Solution

Correct Answer: C
Question #27

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 Answer s.)

  • A . Timestamps
  • B . MD5 checksums
  • C . Inodes
  • D . File sizes
  • E . GnuPG signatures

Reveal Solution Hide Solution

Correct Answer: A,B,D
Question #28

CORRECT TEXT

Which option to the yum command will update the entire system? (Specify ONLY the option name without any additional parameters.)

Reveal Solution Hide Solution

Correct Answer: update, upgrade
Question #29

Which of the following commands can be used to perform a full text search on all available packages on a Debian system?

  • A . apt
  • B . apt-cache
  • C . apt-get
  • D . apt-search
  • E . dpkg

Reveal Solution Hide Solution

Correct Answer: B
Question #30

Which of the following is correct when talking about mount points?

  • A . Every existing directory can be used as a mount point.
  • B . Only empty directories can be used as a mount point.
  • C . Directories need to have the SetUID flag set to be used as a mount point.
  • D . Files within a directory are deleted when the directory is used as a mount point.

Reveal Solution Hide Solution

Correct Answer: A

Question #31

Which of the following commands is used to update the list of available packages when using dpkg based package management?

  • A . apt-get update
  • B . apt-get upgrade
  • C . apt-cache update
  • D . apt-get refresh
  • E . apt-cache upgrade

Reveal Solution Hide Solution

Correct Answer: A
Question #32

You want to preview where the package file, apache-xml.i386.rpm, will install its files before installing it.

What command do you issue?

  • A . rpm -qp apache-xml.i386.rpm
  • B . rpm -qv apache-xml.i386.rpm
  • C . rpm -ql apache-xml.i386.rpm
  • D . rpm -qpl apache-xml.i386.rpm

Reveal Solution Hide Solution

Correct Answer: D
Question #33

CORRECT TEXT

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)

Reveal Solution Hide Solution

Correct Answer: /var, /var/, var, var/
Question #34

When removing a package, which of the following dpkg options will completely remove the files including configuration files?

  • A . –clean
  • B . –delete
  • C . –purge
  • D . Cremove

Reveal Solution Hide Solution

Correct Answer: C
Question #35

CORRECT TEXT

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)

Reveal Solution Hide Solution

Correct Answer: /custom-grub/boot/grub/, /custom-grub/boot/grub
Question #36

Which of the following commands updates the linker cache of shared libraries?

  • A . mkcache
  • B . soconfig
  • C . mkldconfig
  • D . lddconfig
  • E . ldconfig

Reveal Solution Hide Solution

Correct Answer: E
Question #37

CORRECT TEXT

Which command will disable swapping on a device? (Specify ONLY the command without any path or parameters.)

Reveal Solution Hide Solution

Correct Answer: swapoff, /sbin/swapoff
Question #38

Which of the following commands lists the dependencies of a given dpkg package?

  • A . apt-cache depends-onpackage
  • B . apt-cache dependencies package
  • C . apt-cache depends package
  • D . apt-cache requires package

Reveal Solution Hide Solution

Correct Answer: C
Question #39

Which of the following environment variables overrides or extends the list of directories holding shared libraries?

  • A . LD_LOAD_PATH
  • B . LD_LIB_PATH
  • C . LD_LIBRARY_PATH
  • D . LD_SHARE_PATH
  • E . LD_RUN_PATH

Reveal Solution Hide Solution

Correct Answer: C
Question #40

CORRECT TEXT

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.

Reveal Solution Hide Solution

Correct Answer: /tmp, tmp

Question #41

CORRECT TEXT

In which directory must definition files be placed to add additional repositories to yum?

Reveal Solution Hide Solution

Correct Answer: /etc/yum.repos.d, /etc/yum.repos.d/, yum.repos.d, yum.repos.d/
Question #42

CORRECT TEXT

Which world-writable directory should be placed on a separate partition in order to prevent users from being able to fill up the / filesystem? (Specify the full path to the directory.)

Reveal Solution Hide Solution

Correct Answer: /tmp, tmp,/var/tmp, /tmp/, /var/tmp/
Question #43

Which of the following commands lists all currently installed packages when using RPM

package management?

  • A . yum –query –all
  • B . yum –list –installed
  • C . rpm –query –all
  • D . rpm –list Cinstalled

Reveal Solution Hide Solution

Correct Answer: C
Question #44

Which file should be edited to select the network locations from which Debian installation package files are loaded?

  • A . /etc/dpkg/dpkg.cfg
  • B . /etc/apt/apt.conf
  • C . /etc/apt/apt.conf.d
  • D . /etc/apt/sources.list
  • E . /etc/dpkg/dselect.cfg

Reveal Solution Hide Solution

Correct Answer: D
Question #45

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?

  • A . auto-update
  • B . upgrade
  • C . dist-upgrade
  • D . install
  • E . update

Reveal Solution Hide Solution

Correct Answer: C
Question #46

Which of the following commands overwrites the bootloader located on /dev/sda without overwriting the partition table or any data following it?

  • A . dd if=/dev/zero of=/dev/sda bs=512
  • B . dd if=/dev/zero of=/dev/sda bs=512 count=1
  • C . dd if=/dev/zero of=/dev/sda bs=440 count=1
  • D . dd if=/dev/zero of=/dev/sda bs=440

Reveal Solution Hide Solution

Correct Answer: C
Question #47

To what environment variable will you assign or append a value if you need to tell the dynamic linker to look in a build directory for some of a program’s shared libraries?

  • A . LD_LOAD_PATH
  • B . LD_LIB_PATH
  • C . LD_LIBRARY_PATH
  • D . LD_SHARE_PATH
  • E . LD_RUN_PATH

Reveal Solution Hide Solution

Correct Answer: C
Question #48

CORRECT TEXT

What is the name of the main configuration file for GNU GRUB? (Specify the file name only without any path.)

Reveal Solution Hide Solution

Correct Answer: menu.lst, grub.conf, grub.cfg
Question #49

What is the difference between the –remove and the –purge action with the dpkg command?

  • A . –remove removes the program, –purge also removes the config files
  • B . –remove only removes the program, –purge only removes the config files
  • C . –remove removes a package, –purge also removes all packages dependent on it
  • D . –remove removes only the package file itself, –purge removes all files related to the package

Reveal Solution Hide Solution

Correct Answer: A
Question #50

After modifying GNU GRUB’s configuration file, which command must be run for the changes to take effect?

  • A . kill -HUP $(pidof grub)
  • B . grub-install
  • C . grub
  • D . No action is required

Reveal Solution Hide Solution

Correct Answer: D

Question #51

Which of the following commands can be used to download the RPM package kernel without installing it?

  • A . yum download –no-install kernel
  • B . yumdownloader kernel
  • C . rpm –download –package kernel
  • D . rpmdownload kernel

Reveal Solution Hide Solution

Correct Answer: B
Question #52

Which function key is used to start Safe Mode in Windows NT?

  • A . F10
  • B . F8
  • C . F6
  • D . Windows NT does not support Safe Mode

Reveal Solution Hide Solution

Correct Answer: D
Question #53

CORRECT TEXT

The dpkg-____ command will ask configuration questions for a specified package, just as if the package were being installed for the first time.

Reveal Solution Hide Solution

Correct Answer: reconfigure
Question #54

What can the Logical Volume Manager (LVM) be used for? (Choose THREE Answer s.)

  • A . To create RAID 9 arrays.
  • B . To dynamically change the size of logical volumes.
  • C . To encrypt logical volumes.
  • D . To create snapshots.
  • E . To dynamically create or delete logical volumes.

Reveal Solution Hide Solution

Correct Answer: B,D,E
Question #55

Topic 3, GNU and Unix Commands

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?

  • A . <<
  • B . <|
  • C . !<
  • D . &<

Reveal Solution Hide Solution

Correct Answer: A
Question #56

Which of the following commands kills the process with the PID 123 but allows the process to "clean up" before exiting?

  • A . kill -PIPE 123
  • B . kill -KILL 123
  • C . kill -STOP 123
  • D . kill -TERM 123

Reveal Solution Hide Solution

Correct Answer: D
Question #57

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

Reveal Solution Hide Solution

Correct Answer: C
Question #58

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 . 19
  • C . 49
  • D . 99

Reveal Solution Hide Solution

Correct Answer: B
Question #59

You are trying to make a hard link to an ordinary file but ln returns an error.

Which of the following could cause this?

  • A . The source file is hidden.
  • B . The source file is read-only.
  • C . The source file is a shell script.
  • D . You do not own the source file.
  • E . The source and the target are on different filesystems.

Reveal Solution Hide Solution

Correct Answer: E
Question #60

Which of the following commands can be used to create a USB storage media from a disk image?

  • A . gdisk
  • B . dd
  • C . cc
  • D . fdisk
  • E . mount

Reveal Solution Hide Solution

Correct Answer: B

Question #61

In compliance with the FHS, in which of the directories are man pages found?

  • A . /usr/share/man
  • B . /opt/man
  • C . /usr/doc/
  • D . /var/pkg/man
  • E . /var/man

Reveal Solution Hide Solution

Correct Answer: A
Question #62

What is the difference between the i and a commands of the vi editor?

  • A . i (interactive) requires the user to explicitly switch between vi modes whereas a (automatic) switches modesautomatically.
  • B . i (insert) inserts text before the current cursor position whereas a (append) inserts text after the cursor.
  • C . i (independent rows) starts every new line at the first character whereas a (aligned rows) keeps the indentation of the previous line.
  • D . i (interrupt) temporarily suspends editing of a file to the background whereas a (abort) terminates editing.

Reveal Solution Hide Solution

Correct Answer: B
Question #63

A user accidentally created the subdirectory dir in his home directory.

Which of the following commands will remove that directory?

  • A . rmdir ‘~/dir’
  • B . rmdir "~/dir"
  • C . rmdir ~/’dir’
  • D . rmdir ~/dir
  • E . rmdir ~/\dir

Reveal Solution Hide Solution

Correct Answer: E
Question #64

What does the + symbol mean in the following grep regular expression:

grep ‘^d[aei]+d$’ /usr/share/dict/words

  • A . Match the preceding character set ([aei]) one or more times.
  • B . Match the preceding character set ([aei]) zero or more times.
  • C . Match the preceding character set ([aei]) zero or one times.
  • D . Match a literal + symbol.

Reveal Solution Hide Solution

Correct Answer: A
Question #65

What happens after issuing the command vi without any additional parameters?

  • A . vi starts and loads the last file used andmoves the cursor to the position where vi was when it last exited.
  • B . vi starts and requires the user to explicitly either create a new or load an existing file.
  • C . vi exits with an error message as it cannot be invoked without a file name to operate on.
  • D . vi starts in command mode and opens a new empty file.
  • E . vi starts and opens a new file which is filled with the content of the vi buffer if the buffer contains text.

Reveal Solution Hide Solution

Correct Answer: D
Question #66

CORRECT TEXT

Which command displays a list of all background tasks running in the current shell? (Specify ONLY the command without any path or parameters.)

Reveal Solution Hide Solution

Correct Answer: jobs
Question #67

Which of the following files, located in the user home directory, is used to store the Bash history?

  • A . .bash_history
  • B . .bash_histfile
  • C . .history
  • D . .bashrc_history
  • E . .history_bash

Reveal Solution Hide Solution

Correct Answer: A
Question #68

Which of the following commands will print the last 10 lines of a text file to the standard output?

  • A . cat -n 10 filename
  • B . dump -n 10 filename
  • C . head -n 10 filename
  • D . tail -n 10 filename

Reveal Solution Hide Solution

Correct Answer: D
Question #69

Which of the following statements is correct regarding the command foo 1> bar?

  • A . The stdout from the command foo is appended to the file bar.
  • B . The stdout from the command foo overwrites the file bar.
  • C . The command foo receives its stdin from the file bar.
  • D . The command foo receives its stdin from the stdout of the command bar.
  • E . The stderr from the command foo is saved to the file bar.

Reveal Solution Hide Solution

Correct Answer: B
Question #70

Which of the following commands displays the contents of a gzip compressed tar archive?

  • A . gzip archive.tgz | tar xvf ­
  • B . tar ztf archive.tgz
  • C . gzip -d archive.tgz | tar tvf ­
  • D . tar cf archive.tgz

Reveal Solution Hide Solution

Correct Answer: B

Question #71

Which of the following commands determines the type of a file by using a definition database file which contains information about all common file types?

  • A . magic
  • B . type
  • C . file
  • D . pmagic
  • E . hash

Reveal Solution Hide Solution

Correct Answer: C
Question #72

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 Answer s.)

  • A . find /tmp -uid root -print
  • B . find -path /tmp -uid root
  • C . find /tmp -user root -print
  • D . find /tmp -user root
  • E . find -path /tmp -user root Cprint

Reveal Solution Hide Solution

Correct Answer: C,D
Question #73

CORRECT TEXT

Which command is used in a Linux environment to create a new directory? (Specify ONLY the command without any path or parameters.)

Reveal Solution Hide Solution

Correct Answer: mkdir, /usr/bin/mkdir
Question #74

In the vi editor, which of the following commands will copy the current line into the vi buffer?

  • A . c
  • B . cc
  • C . 1c
  • D . yy
  • E . 1y

Reveal Solution Hide Solution

Correct Answer: D
Question #75

While editing a file in vi, the file changes due to another process.

Without exiting vi, how can the file be reopened for editing with the new content?

  • A . :r
  • B . :n
  • C . :w
  • D . :e

Reveal Solution Hide Solution

Correct Answer: D
Question #76

What command will generate a list of user names from /etc/passwd along with their login shell?

  • A . column -s : 1,7 /etc/passwd
  • B . chop -c 1,7 /etc/passwd
  • C . colrm 1,7 /etc/passwd
  • D . cut -d: -f1,7 /etc/passwd

Reveal Solution Hide Solution

Correct Answer: D
Question #77

Which of the following commands moves and resumes in the background the last stopped shell job?

  • A . run
  • B . bg
  • C . fg
  • D . back

Reveal Solution Hide Solution

Correct Answer: B
Question #78

Which of the following commands is used to change options and positional parameters for

a running Bash?

  • A . history
  • B . set
  • C . bashconf
  • D . setsh
  • E . envsetup

Reveal Solution Hide Solution

Correct Answer: B
Question #79

What is the output of the following command?

echo "Hello World" | tr -d aieou

  • A . Hello World
  • B . eoo
  • C . Hll Wrld
  • D . eoo Hll Wrld

Reveal Solution Hide Solution

Correct Answer: C
Question #80

Which of the following command sets the Bash variable named TEST with the content FOO?

  • A . set TEST="FOO"
  • B . TEST = "FOO"
  • C . var TEST="FOO"
  • D . TEST="FOO"

Reveal Solution Hide Solution

Correct Answer: D

Question #81

Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?

  • A . cat < myapp | cat > file1.log
  • B . myapp 0>&1 | cat > file1.log
  • C . myapp | cat > file1.log
  • D . myapp | tee file1.log
  • E . tee myapp file1.log

Reveal Solution Hide Solution

Correct Answer: D
Question #82

Which of the following shell redirections will write standard output and standard error output to a file named filename?

  • A . 2>&1 >filename
  • B . >filename 2>&1
  • C . 1>&2>filename
  • D . >>filename
  • E . 1&2>filename

Reveal Solution Hide Solution

Correct Answer: B
Question #83

Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose TWO Answer s.)

  • A . Ctrl XX
  • B . Ctrl :W
  • C . Esc zz
  • D . Esc :wq
  • E . Esc ZZ

Reveal Solution Hide Solution

Correct Answer: D E
Question #84

Which of the following commands can be used to determine how long the system has been running? (Choose TWO Answer s.)

  • A . uptime
  • B . up
  • C . top
  • D . uname -u
  • E . time Cup

Reveal Solution Hide Solution

Correct Answer: A,C
Question #85

Which of the following commands will reduce all consecutive spaces down to a single space?

  • A . tr ‘s’ ‘ ‘ < a.txt > b.txt
  • B . tr -c ‘ ‘ < a.txt > b.txt
  • C . tr -d ‘ ‘ < a.txt > b.txt
  • D . tr -r ‘ ‘ ‘
    ‘ < a.txt > b.txt
  • E . tr -s ‘ ‘< a.txt > b.txt

Reveal Solution Hide Solution

Correct Answer: E
Question #86

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.)

  • 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

Reveal Solution Hide Solution

Correct Answer: A,B
Question #87

Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?

  • A . fmt -f 1,4 /etc/passwd
  • B . split -c 1,4 /etc/passwd
  • C . cut -d : -f 1,4 /etc/passwd
  • D . paste -f 1,4 /etc/passwd

Reveal Solution Hide Solution

Correct Answer: C
Question #88

When running the command

sed -e "s/a/b/" /tmp/file >/tmp/file

While /tmp/file contains data, why is /tmp/file empty afterwards?

  • A . The file order is incorrect. The destination file must be mentioned before the command to ensure redirection.
  • B . The command sed did not match anything in that file therefore the output is empty.
  • C . When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens itfor reading.
  • D . Redirection for shell commands do not work using the > character. It only works using the | character instead.

Reveal Solution Hide Solution

Correct Answer: C
Question #89

Which of the following explanations are valid reasons to run a command in the background of your shell?

  • A . The command does not need to execute immediately.
  • B . The command has to run immediately but the user needs to log out.
  • C . The system is being shut down and the command needs to restart execution immediately after the reboot.
  • D . The command can run at a lower priority than normal commands run on the command line.

Reveal Solution Hide Solution

Correct Answer: B
Question #90

Which grep command will print only the lines that do not end with a / in the file foo?

  • A . grep’/$’ foo
  • B . grep ‘/#’ foo
  • C . grep -v ‘/$’ foo
  • D . grep -v ‘/#’ foo

Reveal Solution Hide Solution

Correct Answer: C

Question #91

What is the purpose of the Bash built-in export command?

  • A . It allows disks to be mounted remotely.
  • B . It runs a command as a process in a subshell.
  • C . It makes the command history available to subshells.
  • D . It sets up environment variables for applications.
  • E . It shares NFS partitions for use by other systems on the network.

Reveal Solution Hide Solution

Correct Answer: D
Question #92

What is the effect of the egrep command when the -v option is used?

  • A . It enables color to highlight matching parts.
  • B . It only outputs non-matching lines.
  • C . It shows the command’s version information.
  • D . It changes the output order showing the last matching line first.

Reveal Solution Hide Solution

Correct Answer: B
Question #93

Which of the following are valid stream redirection operators within Bash? (Choose THREE Answer s.)

  • A . <
  • B . <<<
  • C . >
  • D . >>>
  • E . %>

Reveal Solution Hide Solution

Correct Answer: A,B,C
Question #94

Which character, added to the end of a command, runs that command in the background as a child process of the current shell?

  • A . !
  • B . +
  • C . &
  • D . %
  • E . #

Reveal Solution Hide Solution

Correct Answer: C
Question #95

In Bash, inserting 1>&2 after a command redirects

  • A . standard error to standard input.
  • B . standard input to standard error.
  • C . standard output to standard error.
  • D . standard error to standard output.
  • E . standard output to standard input.

Reveal Solution Hide Solution

Correct Answer: C
Question #96

Which variable defines the directories in which a Bash shell searches for executable commands?

  • A . BASHEXEC
  • B . BASHRC
  • C . PATH
  • D . EXECPATH
  • E . PATHRC

Reveal Solution Hide Solution

Correct Answer: C
Question #97

Regarding the command:

nice -5 /usr/bin/prog

Which of the following statements is correct?

  • A . /usr/bin/prog is executed with a nice level of -5.
  • B . /usr/bin/prog is executed with a nice level of 5.
  • C . /usr/bin/prog is executed with a priority of -5.
  • D . /usr/bin/prog is executed with a priority of 5.

Reveal Solution Hide Solution

Correct Answer: B
Question #98

What does ?the symbol within regular expressions represent?

  • A . Match the preceding qualifier one or more times.
  • B . Match the preceding qualifier zero or more times.
  • C . Match the preceding qualifier zero or one times.
  • D . Match a literal ?character.

Reveal Solution Hide Solution

Correct Answer: C
Question #99

Which shell command is used to continue background execution of a suspended command?

  • A . &
  • B . bg
  • C . cont
  • D . exec
  • E . :&

Reveal Solution Hide Solution

Correct Answer: B
Question #100

Which of the following commands replaces each occurrence of ‘bob’ in the file letter with ‘Bob’ and writes the result to the file newletter?

  • A . sed ‘/bob/Bob’ letter > newletter
  • B . sed s/bob/Bob/ letter < newletter
  • C . sed’s/bob/Bob’ letter > newletter
  • D . sed ‘s/bob/Bob/g’ letter > newletter
  • E . sed ‘s/bob, Bob/’ letter > newletter

Reveal Solution Hide Solution

Correct Answer: D
Exit mobile version