linux test 2
Which of the following characters can be entered at the beginning of a line in a shell script to ensure that line is recognized as a comment rather than try to execute it?
#
Which command can be used to download an updated copy of the master branch from the original Git repository?
git pull origin master
Which of the following commands can be used to convert files between different character encodings?
iconv
The quotas for certain users can be edited by using which command?
edquota
Which command mounts all existing filesystems in /etc/fstab?
mount -a
Which of the following commands will display the output of a file while also displaying a line number at the left side of each line for the /etc/passwd file?
nl /etc/passwd
Both aliases and functions can be used to store commands that can be executed, but functions can also accept positional parameters. True or False?
true
The lvextend command can be used to add unused space within a volume group to an existing logical volume. True or False?
true
The sed and awk commands are filter commands commonly used to format data within a pipe. True or False?
true
Which of the following does Click Assist do?
Simulates a right click by holding down the left mouse button.
Which of the following variables could access the value "/etc" within the sample shell script, if the sample shell script was executed using the bash sample /var /etc /bin command?
$2
Which of the following commands will display the number of seconds that have elapsed since January 1, 1970?
date +%s
Which command should you run after installing a new kernel module to update the module dependency database?
depmod
Which command is used to display the amount of free space that exists on a filesystem?
df
You want to see the filesystems that are in use on the system. What command could you use? (Choose all that apply.)
df -T cat /etc/mtab
What does the du -s /var command do?
displays the total size of the /var directory
Which of the following commands will display messages that were displayed during the boot sequence by the kernel?
dmesg
Which of the following commands when run from the /, or root, directory will return a very long list of many pages of results?
du
What does the command dumpe2fs -h do?
dumps an ext2 filesystem
Which command is used to format a partition on a hard disk drive with the ext4 filesystem?
e2mkfs -t ext4 device
Which of the following commands will display the exit status of the last command used in the BASH shell?
echo $?
You have just created a variable named CREATOR. Which of the following commands will display the contents of the variable to standard output?
echo $CREATOR
Before a user-defined variable can be used by processes that run in subshells, that variable must be __________.
exported
If the mkfs command is executed to create a filesystem and only the block device name is specified, which of the following filesystems will be created?
ext2
After a partition on a hard disk is formatted with a filesystem, all partitions on that hard disk drive must use the same filesystem. True or False?
false
BTRFS filesystems do not need to be checked for errors as they are resilient to data corruption. True or False?
false
Because stderr and stdout represent the results of a command and stdin represents the input required for a command, only stderr and stdout can be redirected to/from a file. True or False?
false
Character devices typically transfer data more quickly than block devices. True or False?
false
DM-MPIO can be configured to provide multiple, redundant connections to data stored on a SAN. True or False?
false
ZFS volumes are mounted at boot time from entries within /etc/fstab by default. True or False?
false
Every if construct begins with if and must be terminated with?
fi
When writing shell scripts and using an if statement to determine whether a set of code should be executed, what is the proper syntax to end the if construct? ___________
fi
Match the file with the order in which the BASH shell environment files are read:
first: /etc/profile second: /etc/profile.d/* third: /etc/bashrc fourth: ~/.bashrc
What command can be used to check different kinds of filesystems on Linux for errors?
fsck
Which of the following commands can only be used to create partitions on a GPT hard disk?
gdisk
Which of the following commands will prompt to convert an MBR partition to GPT, thus destroying all existing MBR partitions on a disk?
gdisk
Which of the following commands should you use to specify that you want to use Git for version tracking on them?
git add
What Systemd target corresponds to runlevel 5?
graphical.target
Which of the following will look at the /etc/passwd file for any lines containing the word root and display them out to the screen while simultaneously writing the results to a file?
grep root /etc/passwd | tee ~/root.txt
A device file _______________________. (Choose all that apply.)
has no data section displays a major and minor number in place of a file size
Which of the following indicates the second MBR partition on the third hard disk drive to GRUB2?
hd2,msdos2
Which of the following can be used to compare the hardware clock to the system clock, writing a new result to a new line every 10 seconds?
hwclock -c
You have recently modified the system time using the date command. What command can you run to ensure that the same time is updated within the system BIOS?
hwclock -w
Which of the following is a type of software that allows a piece of hardware to host multiple operating systems?
hypervisor
Which of the following describes a computer that is used to access an iSCSI hard disk across the network?
iSCSI initiator
Which of the following constructs can be used in a shell script to determine whether two values are equal and if so run another set of commands?
if
Where is the /proc filesystem stored?
in RAM
The first daemon loaded on a Linux system is _____.
init
Which command causes the system to enter Single User Mode?
init 1
What file in the /proc directory contains a list of memory address ranges reserved for device use?
ioports
Which of the following commands can be used to create and activate a swap partition on a Linux system? (Each answer represents part of the whole.)
mkswap /dev/sda6 swapon /dev/sda6
Leonard wants to find detailed information about the Bluetooth kernel module. Which of the following commands can he use to display this information?
modinfo bluetooth
What file under the proc directory contains information regarding what modules are currently loaded into the Linux kernel?
modules
Which of the following is the default window manager used by the GNOME version 3 desktop environment?
mutter
Which of the following virsh commands will display the total amount of memory as well as the amount of free memory for a node?
nodememstats
Which of the following commands will prompt you to answer a series of questions to help determine which time zone file you should use?
tzselect
Elijah is done working with an external USB hard drive and wants to properly disconnect it. Which of the following commands should he use before unplugging the USB cable?
umount
Which of the following operators reverses the meaning of a test statement?
!
Which of the following is the common escape sequence to display a horizontal tab using the echo command?
\t
Which of the following statements is true?
UTF-8 is commonly used to provide Unicode character set support.
To ensure that Linux has detected the correct amount of RAM in the system after installation, you should view the contents of what file in the proc directory?
/proc/meminfo
Which of the following statements regarding LVM structure is correct?
VGs are comprised of one or more PVs
Which of the following commands will count down from 10 to 1?
seq 10 -1 1
Which of the following lines can be used to perform command substitution within a shell script? (Choose all that apply.)
'command' $(command)
Callie wants to make sure that a filesystem is checked every 20 days. Which of the following options, when used with the tune2fs command, would set a full filesystem check to run every 14 days?
-i 14d
Which of the following can be used for comparing values within an if statement? (Choose two.)
-lt =
The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.)
. echo ~ echo $HOME
Which of the following files can you add filenames to so that the git add * command will not stage them?
.gitignore
Given the following output from /etc/fstab, which filesystems will be automatically checked on boot by the fsck command?
/, /proc, and swap
In what directory is Stage2 of the GRUB2 boot loader stored?
/boot
Which of the following is required as a separate partition in order to use LVM?
/boot
Which of the following would be the device file for the third partition on the second SATA drive on a Linux system?
/dev/sdb3
You plug a USB flash memory drive into a system that has two SATA hard disks. How will the partition on this USB flash memory drive be identified by Linux?
/dev/sdc1
Jackson wants to automatically mount a secondary internal hard drive when his Linux workstation boots up. In which of the following files should he configure an entry for the partition on the drive that he wants to mount?
/etc/fstab
Which file should be configured so that quotas are enabled at boot time?
/etc/fstab
Which directory stores most UNIX SysV rc scripts?
/etc/init.d
Which file does the UNIX SysV init daemon reference on startup to determine the default runlevel?
/etc/inittab
Which of the following files is where the default runlevel is set on some Linux systems?
/etc/inittab
Which of the following files is a binary file that contains the rules for calculating the time based on your time zone relative to epoch time?
/etc/localtime
Which of the following files is always executed immediately after any user logs in to a Linux system and receives a BASH shell?
/etc/profile
What is the name of the directory that contains symbolic links to UNIX SysV rc scripts for runlevel 2?
/etc/rc2.d
Which of the following directories is created by default when an ext2, ext3, or ext4 filesystem is created on a device that is used by the fsck utility?
/lost+found/
What file in the /proc directory contains information about a computer's CPU?
/proc/cpuinfo
To which directory will the test ZFS volume from the previous question be mounted by the ZFS system?
/test
In addition to /etc/localtime, some Linux distributions also have an /etc/timezone text file that contains a reference to the correct time zone file contained in which directory?
/usr/share/zoneinfo
Where are the files stored that contain information for all of the time zones that could be recognized by a Linux operating system?
/usr/share/zoneinfo
You want to view log files to get information about a problem that occurred during a Linux installation. In which directory will you likely find the log files?
/var/log
Which runlevel halts the system?
0
Which of the following would be the results of running the command seq 7?
1 through 7 being displayed one number per line.
Linux servers are typically installed in a rack using rackmount server hardware. Which of the following describes the minimum height of a rackmount server?
1U
Which of the following represents stderr at the command line when used for redirection?
2
If the physical extent of a volume group is set to 32MB, what is the maximum logical volume size?
2TB
Which of the following will take output from a command and append it to the end of a file?
>>
Which of the following can be used to mount a filesystem? (Choose all that apply.)
A device path such as /dev/sdb2 A filesystem UUID A filesystem label
Which of the following statements is true?
After modifying /etc/default/grub, you must run the grub2-mkconfig command before the changes are made to GRUB2.
How do you indicate a comment line in a shell script?
Begin the line with #.
Which of the following commands can be used to create a BASH variable named CREATOR with the value of Torvalds?
CREATOR="Torvalds"
Which of the following is the default desktop environment used by Linux Mint?
Cinnamon
What component of a Linux server is used to connect to a Fibre Channel SAN?
FC HBA
Which of the following is an on-screen keyboard used with Linux?
GOK
Which assistive technology will make a desktop environment more accessible to a person with low vision?
High Contrast
What does &> accomplish when entered on the command line after a command?
It redirects both stderr and stdout to the same location.
Which of the following will the split command do on a file when no other options are specified?
It will split a file into new equally sized files that are 1/10th of the original file size.
Which of the following options is passed to the Linux kernel from the GRUB2 configuration file to set the locale?
LANG
When viewing the output of the lsmod command, you notice several modules that start with vmw. What does this indicate?
Linux is running as a guest operating system.
You want to configure the runlevels that a particular upstart daemon is started in. What should you do?
Modify the daemon configuration file within the /etc/init directory
Jim has just installed two new SAS SSDs in his system. He properly installs the hardware in his machine. Before he can use them for data storage and retrieval, what must he do? (Choose all that apply.)
Mount any partitions created on the two SSDs such that they are accessible by the operating system. Format any partitions created on the SSDs with a valid filesystem recognized by Linux.
A user runs the fsck command with the -f option on an ext4 filesystem that is showing signs of corruption. How would that user locate any files the system was unable to repair?
Mount the filesystem and check the lost+found directory underneath the mount point.
Which of the following statements are true? (Choose all that apply.)
Quotas can limit both user space and the number of files a user can own. Hard limits can never be exceeded. Soft limits allow a user to exceed them for a certain period of time.
Which of the following RAID levels is not fault tolerant?
RAID 0
What type of redundant storage configuration is most common for hosting the operating system and applications on a server?
RAID 5
Aria has modified the hard disk that hosts the operating system by using the fdisk command. The fdisk command indicates that the new partition information must be manually reloaded. Which of the following should she do next? (Choose two. Either answer is independently correct.)
Run the partprobe command Reboot the system
If a Linux installation ends abnormally and the screen displays a fatal signal 11 error, what type of error has occurred?
Segmentation fault
Which of the following is a valid Linux initialization process?
Systemd SysV
Which of the following system variables can you modify to override the default system timezone within your current shell?
TZ
Each SCSI device attached to a system must be assigned an ID number. What is this ID number called?
Target ID
Consider the following shell script: echo -e "What is your favorite color?--> \c" read REPLY if [ "$REPLY" = "red" -o "$REPLY" = "blue" ] then echo "The answer is red or blue." else echo "The answer is not red nor blue." fi
The answer is not red nor blue.
Which of the following does a Linux kernel use to store the value of epoch time?
The number of seconds since January 1, 1970
You attempt to perform the git commit -m "Added listdir function" but the command fails. What are possible reasons for the failure? (Choose all that apply.)
The user performing the commit has not set their Git user information. No files were added to the Git index beforehand. The user performing the commit is not running the command from within the Git repo directory.
A user mounts a device to a mount point directory and realizes afterward she needs files previously found within the mount point directory. What should this user do?
Unmount the device from the directory
Which of the following is responsible for starting tasks and services during boot, stopping them during shutdown, and supervising them while the system is running?
Upstart
What would be the effect of using the alias command to make an alias for the date command named cat in honor of your favorite pet?
When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead.
What is contained in the DISPLAY variable on a Linux system running the X window system?
Which X server the client is supposed to connect to by default.
You have redirected stderr to a file called Errors. You view the contents of this file afterward and notice that there are six error messages. After repeating the procedure, you notice that there are only two error messages in this file. Why?
You did not append the stderr to the Error file, and, as a result, it was overwritten when the command was run a second time.
Which two implementations of X Windows are commonly used in Linux? (Choose two answers.)
X.org Wayalnd
Which of the following is a lightweight desktop environment that uses very few system resources that a system administrator might choose to install on a Linux server instead of one of the two main desktop environments?
XFCE
What is the term for a ZFS managed filesystem that is created from ZFS pools?
ZFS volume
Levi wants to run 5 commands sequentially, but does not want to create a shell script. He knows that each command is going to take approximately 20 minutes to run individually. However, he would like to go to lunch 15 minutes from now. He knows that he can type all of the commands on the same line and separate them with a certain character to run them sequentially. Which character can he type after each command to have them run one after the next without requiring further input from him?
a semicolon
Which command can be used to create a new command that will monitor the contents of auth.log as they get added to the file?
alias showauth='tail -f /var/log/auth.log'
Which of the following could result in a segmentation fault (fatal signal 11) during a Fedora installation?
all of the above
Which of the following commands can be used to display the filesystem and partition UUIDs on a Linux system?
blkid
Which of the following results would be created by the command sequence: echo 'apple banana carrot dog elephant' | while read a b c; do echo result: $c $b $a; done
carrot dog elephant banana apple
Which of the following commands will send the output of the cat command to the grep command to be filtered?
cat /etc/passwd | grep jsmith
Which of the following commands will display the current CPU(s) detected by a Linux system?
cat /proc/cpuinfo
Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed?
cd /home/user1 && echo "welcome home"
Which of the following commands can be used to start a UNIX SysV daemon called lala in runlevels 1, 2 and 3?
chkconfig --level 123 lala on
Select the command that can be used to change the root filesystem to a different directory, such as when you are in a rescue environment.
chroot
Which command can you use during a system rescue to switch from the root of the live OS to the root of the Linux system installed on the hard disk?
chroot
Which of the following commands can be used on a modern Linux system to view hardware information that was captured at the beginning of the boot process?
journalctl -k
In Fedora 20, what journaling database system has replaced the logging system used to record the messages normally stored within the boot.log, messages, and syslog files?
journald
Which of the following will invalid entries in the GRUB2 configuration cause?
kernel panic and halt the system
In order to create and manage KVM or Qemu virtual machines, a Linux system must have which of the following installed?
libvert
Which of the following commands will show a number of environment variables that start with LC_?
locale
Which of the following commands can be used to display the current locale of a system? (Choose two.)
locale localectl
Which command can be used to modify the default locale on the system?
localectl
Which of the following can be used to show the block devices on a Linux system? (Choose two.)
ls /sys/block lsblk
Which of the following commands can be used to show the block devices, including their major and minor numbers, on a system which are located in the /sys/block directory?
lsblk
Which of the following commands can be used to display general hardware information for the entire system?
lshw
Which of the following commands can quickly determine whether your network hardware was detected properly following a Linux installation?
lshw -class network
A government office wants to secure a few of its Linux systems so that they can only use certain USB devices. After plugging in a USB device, which of the following commands could be used to detect certain identifying information that can be used to only allow that type of USB device?
lsusb
What command is used to manage a software RAID configuration after installation?
mdadm
Which of the following commands can be used to create and manage a software RAID configuration after installation?
mdadm
Which of the following files holds the configuration information for GRUB Legacy on Ubuntu Linux systems?
menu.lst
The subdirectory newdir does not currently exist in the current directory that you are in. Which of the following commands will create a new directory named newdir and then change into that directory? (Choose two.)
mkdir newdir; cd newdir mkdir newdir && cd newdir
Which of the following commands cannot be used to create an exFAT filesystem on a USB thumb drive that is recognized as /dev/sdb?
mkfs exfat /dev/sdb1
Which of the following commands will generate a new initramfs?
mkinitrd dracut
Clint has run the command parted /dev/sdb and wants to display a list of the existing partitions that exist on that drive. Which of the following commands can he use to display the existing partitions?
Which of the following commands can be used to scan a filesystem for disk usage, create, check, and repair quota files?
quotacheck
Which construct can be used in a shell script to read stdin and place it in a variable?
read
Which of the following can be included in a shell script to ask the user to type in a password and then store it in the variable named $password?
read -s -p "Please enter the password: " password
Which of the following commands will display a summarization of quotas for a filesystem?
repquota
Which of the following commands will show the current runlevel along with the previous runlevel? (Choose all that apply.)
runlevel
Which of the following is not a type of RAID?
serial RAID
Which command could you use to see a list of all environment and user-defined shell variables as well as their current values?
set
What kernel option can be specified within a boot loader to force the system to boot to Single User Mode?
single
Which type of RAID can be entirely configured during the Linux installation process?
software RAID
Which of the following commands will display the contents of the /etc/passwd file in alphanumerical order?
sort /etc/passwd
Which of the following is a valid method of running a script named myscript.sh? (Choose two)
source myscript.sh ./myscript.sh
Which command can be used to start X Windows, the window manager, and the default desktop environment?
startx
Which of the following accessibility features simulates simultaneous key presses when two keys are pressed in sequence?
sticky keys
Which of the following is a virtual filesystem that is made up of virtual files that a Linux operating system is able to export information to about kernel sub-systems, hardware devices, and device drivers to make it easy for users to access the information?
sysfs
Which of the following commands will set the default runlevel of a Linux system?
systemctl set-default runlevel5.target
Which of the following Systemd commands can be used to stop a daemon called lala?
systemctl stop lala.service
Which of the following commands will display a list of Systemd units sorted by the time they took to load?
systemd-analyze blame
Which of the following commands will shut down a Linux system? (Choose all that apply.)
telinit 0 shutdown -h now poweroff
When configuring a virtual hard disk file, which term refers to the feature that allows the virtual hard disk file to expand dynamically as space is requested by the guest operating system?
thin provisioning
Which of the following commands will list the time zones available on a Linux system?
timedatectl list-timezones
Which of the following options can be specified in the GRUB Legacy configuration file to set how long the boot menu is displayed before loading the default image?
timeout
A for construct is a loop construct that processes a specified list of objects. As a result, it is executed as long as there are remaining objects to process. True or False?
true
John has been using the cdrom on his computer that is running the Linux operating system. He pushes the eject button on the front of the drive, but it doesn't eject the disk. Which of the following commands should he run? (Choose all that apply.)
umount /media/cdrom eject /media/cdrom
An alias has previously been created named showauth. Which of the following commands can be used to get rid of that alias?
unalias showauth
What must you do to successfully run the fsck command on a filesystem?
unmount the filesystem
How many times will the following loop execute as part of a script: #!/bin/bash COUNTER=0 while [ $COUNTER -lt 7 ] do echo "hello world" done
until ctrl-c is used to terminate it
On a system using the KVM hypervisor, which of the following modules would you expect to see as part of the output of the lsmod command on a guest Linux virtual machine?
virtio
Which of the following commands will count the number of lines in a file named data.csv?
wc -l data.csv
Using the syntax below, what command will create directories named one, two, and three? echo one two three | ___________ mkdir
xargs
Archie wants to optimize an XFS filesystem and minimize the chance of future corruption. Which of the following commands will compact or otherwise improve the layout of the contiguous blocks of file data for an XFS filesystem?
xfs_fsr
Which command can be used to repair an XFS filesystem?
xfs_repair /dev/sdb1
What command can be used to create a ZFS volume called test from the space on /dev/sdb and /dev/sdc that functions like RAID level 1?
zpool create test mirror /dev/sdb /dev/sdc
If incompatible X Windows settings are configured, where will the errors that are generated be written to?
~/.xsession-errors