review questions 7-8
The current value for the HOME variable is displayed by which of the following commands?
echo ~
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
The first daemon loaded on a Linux system is _____.
init
Which command could you use to see a list of all environment and user-defined shell variables as well as their current values?
set
Which command can be used to start X Windows, the window manager, and the default desktop environment?
startx
Which of the following lines can be used to perform command substitution within a shell script?
$(command)
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
In what directory is Stage2 of the GRUB2 boot loader stored?
/boot
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 always executed immediately after any user logs in to a Linux system and receives a BASH shell?
/etc/profile
Which runlevel halts the system?
0
Which of the following statements is true? GRUB Legacy can be loaded from a MBR or GPT. After modifying /etc/default/grub, you must run the grub2-mkconfig command before the changes are made to GRUB2. GRUB2 can only be loaded from a UEFI System Partition. GRUB needs to be reinstalled after it has been modified.
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 #.
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
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.
You attempt to perform the git commit -m "Added listdir function" but the command fails. Which of the following is NOT a possible reason for the failure?
No files were added to the Git index beforehand.
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
Which implementation of X Windows are commonly used in Linux?
Wayland
Every if construct begins with if and must be terminated with?
fi
The sed and awk commands are filter commands commonly used to format data within a pipe. True or False?
true
Which of the following operators reverses the meaning of a test statement?
!
What is the name of the directory that contains symbolic links to UNIX SysV rc scripts for runlevel 2?
/etc/rc2.d
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
You attempt to perform the git commit -m "Added listdir function" but the command fails. Which of the following is NOT apossible reason for the failure?
The master branch was not specified within the command itself.
Which of the following statements is true?
UTF-8 is commonly used to provide Unicode character set support.
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.
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�
Before a user-defined variable can be used by processes that run in subshells, that variable must be __________.
exported
What Systemd target corresponds to runlevel 5?
graphical.target
Which of the following indicates the second MBR partition on the third hard disk drive to GRUB2?
hd2,msdos2
Which command causes the system to enter Single User Mode?
init 1
Which command can be used to modify the default locale on the system?
localectl
What kernel option can be specified within a boot loader to force the system to boot to Single User Mode?
single
Which of the following Systemd commands can be used to stop a daemon called lala?
systemctl stop lala.service
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
Consider the following shell script:echo -e �What is your favorite color?--> \c�read REPLYif [ �$REPLY� = �red� �o �$REPLY� = �blue� ]then echo �The answer is red or blue.�else echo �The answer is not red nor blue.�fi What would be displayed if a user executes this shell script and answers Blue when prompted?
The answer is not red nor blue.
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 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
Which construct can be used in a shell script to read stdin and place it in a variable?
read
