NOS 120 final
Which of the following operators reverses the meaning of a test statement? a. -o b. ! c. #! d. -a
!
In order to redirect a file to the standard input of a command what metacharacter should be used? ,
"<"
The first line in a script usually starts with which of the following?
#!
What character combination at the start of a shell script are referred to as a hashpling and allow for the specification of the shell that interprets the contents of the script?
#!
When killing a background job with the kill command the background job ID must be prefixed by what character below?
%
In standard GRUB notation select the option below that represents the first hard drive in a system, and the first partition on that hard drive
(hd0,0)
Which of the following indicates the second partition on the third hard disk drive to GRUB?
(hd2,1)
When there are multiple background processes executing in the shell the jobs command indicates the most recent one with which symbol?
+
What option can be added to the rpm command to upgrade a specified package only if an older version exists on the system?
-F
A user account can be locked with the usermod command using what option?
-L
Which option to the dpkg command can be used to list the files that comprise a package?
-L
What option can be added to the dpkg command to remove a specified package from the system including any configuration files used by the package?
-P
What two options below are used to tell the useradd command where a user's home directory will be and where the skeleton directory is?
-d, -k
What two ps options can be used to display a full list of information about each process and a long list of information about each process?
-e -f
What option can be added to the rpm command in order to query packages?
-q
What option can be added to the userdel command to remove the home directory of the target user?
-r
When compiling source code into a binary program which command performs a system check and creates the Makefile?
./configure
Which filename extension indicates a tarball?
.tar.gz
Files with what two file extensions are commonly known as tarballs?
.tar.gz .tgz
In what directory is Stage2 of the GRUB2 boot loader stored?
/boot
In Fedora 20 where are user configured settings for Xorg stored?
/etc/X11/xorg.conf.d/
What configuration file contains parameters that set the default location for e-mail password expiration information, minimum password length, and the range of UIDs and GIDs available for use?
/etc/cups/printers.conf
What are two means available to resolve a host name to the appropriate TCP/IP address? (Choose two answers.)
/etc/hosts DNS
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 file contains default information such as UID and GID ranges and minimum password length to be used at user creation?
/etc/login.defs
Which file holds the methods to be used and the order in which they will be applied for host name resolution?
/etc/nsswitch.conf
What is the name of the file that contains a listing of all users on the system and their home directories?
/etc/passwd
Which of the following files is always executed immediately after any user logs in to a Linux system and receives a BASH shell? a. ~/.bash_login b. ~/.profile c. ~/.bash_profile d. /etc/profile
/etc/profile
What two files below are the first two BASH environment files to be executed?
/etc/profile /etc/bashrc
What is the name of the directory that contains symbolic links to UNIX SysV rc scripts for runlevel 2?
/etc/rc2.d
Which file stores the TCP/IP addresses of the DNS servers used to resolve host names if no DNS servers are specified within the network configuration file for the NIC?
/etc/resolv.conf
Where is the skeleton directory located on most Linux systems?
/etc/skel
Which file would you modify to permanently change the TCP/IP address of the first wired NIC on a Fedora 20 system?
/etc/sysconfig/network-scripts/ifcfg-eth0
What file controls the default runlevel when using Systemd?
/etc/systemd/system/default.target
On Linux the root user always has a UID of what number?
0
Which runlevel halts the system?
0
Which of the following file descriptor numbers represents stdout? a. 0 b. 2 c. 1 d. 3
1
How many different kill signals can be sent by the kill command to a given process?
64
What kill level signal cannot be trapped?
9
Which metacharacter is used to append the results of one command at the end of a file ?
>
Which metacharacters are used to send the results of a command to a file?
>
Which metacharacters are sent the results of a command to a file and override the original content of a file?
> >>
How do you indicate a comment line in a shell script? a. Begin the line with #!. b. There are no comment lines in a shell script. c. Begin the line with !. d. Begin the line with #.
Begin the line with #.
Which of the following statements is true?
Either the MBR/GPT or the active partition can contain the boot loader.
A list of all exported environment and user-defined variables in a shell can be viewed with what command below?
Env
A case construct must be ended by ____________________.
Esac
Before a user-defined variable can be used by processes that run in subshells that variable must be: a. validated by running the env command b. imported c. exported d. redirected to the BASH shell ,
Exported
Along with a listing of user accounts the /etc/passwd file also contains information on account expiry. True or False?
False
Because Standard Error and Standard Output represent the results of a command and Standard Input represents the input required for a command only Standard Error and Standard Output can be redirected to/from a file. True or False?
False
The Debian Package Manager (DPM) is the default package manager used by Fedora 20. True or False?
False
The killall command uses the PID to kill a process.
False
To install a new program from RPM software repositories on the Internet you can use the yum update program name command. True or False?
False
To kill a process running in the background you must place a % character before its process ID. True or False?
False
To prevent a file from being cleared by the BASH shell and append output to the existing output you can specify three > metacharacters alongside the file descriptor. ,
False
UIDs and GIDs are unique to the system and once used can never be reused. True or False?
False
The sed and awk commands are filter commands commonly used to format data within a pipe. True or False?
False (TEST TRUE)
Any command that can take standard input and transform it into standard output is called a(n) ____________________ command.
Filter
What construct is intended for use in processing a list of objects such as files, directories, users, printers, and so on?
For
The term used to describe a process spawning or initiating another process is referred to as_____.
Forking
Which command entered without arguments is used to display a list of processes running in the current shell?
Ps
A system that uses an /etc/passwd file only can be converted to use /etc/shadow for security by using what command?
Pwconv
What keyword tells the Linux kernel to avoid printing errors to the screen during system startup?
Quiet
Most Linux distributions make use of what package manager?
RPM
The ____________________ command takes user input from stdin and places it in a variable specified by an argument.
Read
Which construct can be used in a shell script to read Standard Input and place it in a variable? a. sum b. verify c. read d. test
Read
What two BASH environment variables represent the current working directory and the absolute pathname of the current shell, respectively?
SHELL PWD
What kill signal stops a process then restarts it with the same PID?
SIGHUP
What kill signal and number can be used to send an interrupt signal to a process and is the same as using the Ctrl+c combination to kill a running process?
SIGINT 2
Which kill signal terminates a process by taking the process information in memory and saving it to a file called core on the hard disk in the current working directory?
SIGQUIT
The timeout value in the GRUB configuration file is measured in?
Seconds
Which filter command can be used to search and replace a certain string of text?
Sed
Which command could you use to see a list of all environment and user-defined shell variables as well as their current values? a. env b. ls /var c. echo d. set
Set
What keyword can be specified within a boot loader to force the system to boot to Single User Mode?
Single
A file descriptor that represents any error messages generated by a command.
Standard Error (stderr)
Which of the following is not necessarily generated by every command on the system? (Choose all that apply.) a. Standard Ouput b. Standard Error c. Standard Input d. Standard Home
Standard Input
A file descriptor that represents information input to a command during execution.
Standard Input (stdin)
A file descriptor that represents the desired output from a command.
Standard Output (stdout)
Which command can be used to start X Windows the window manager, and the default desktop environment? ,
Startx
What term is used to describe text that is input by a user typing on a keyboard and is used for command execution?
Stdin
Most commands that are run by the shell are run in a separate ____________________ which is created by the current shell.
Subshell
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 What would be displayed if a user executes the program in question 20 and answered Blue when prompted? a. The answer is red or blue. The answer is not red nor blue. b. The code would cause an error. c. The answer is not red nor blue. d. The answer is red or blue.
The answer is not red nor blue
In the process state column what does an "R" indicate?
The process is currently running on the processor.
When viewing the output of the ps ax command what does a < symbol in the STAT column indicate for a process?
The process is high priority.
When you run the ps command how are daemon processes recognized?
There is a question mark in the TTY column.
Which command is used to gain real-time information about processes running on the system with the most processor-intensive processes listed at the beginning of the list?
Top
Which process will always have a PID of 1 and a PPID of 0?
Top
What command can be used to replace characters in a file sent via Standard Input?
Tr
Which command can be used to transform or change characters received from Standard Input?
Tr
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
As daemon processes are not associated with terminals you must use the -e switch with the ps command to view them. True or False?
True
Because the Makefile often includes some documented items it is good form to read the Makefile after running the configure script.
True
Most source code is available on the Internet in tarball format. True or False?
True
Much like the SysV init daemon the Systemd init daemon is used to start daemons during system initialization as well as start and stop daemons after system initialization.
True
The alias command can be used to make a shortcut to a single command. True or False?
True
The line that configures the host name for the computer at boot time can be found in /etc/sysconfig/network. True or False?
True
You can lock a user account by changing the default login shell to an invalid shell in /etc/passwd. True or False?
True
You can use the sed command to remove unwanted lines of text.
True
In order to create user accounts on a Linux system what command should be utilized?
Useradd
Which command can be used to count the number lines words, and characters in a file? ,
Wc
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? a. It cannot be done as there already is a command cat on the system. b. It cannot be done as there already is an environment variable cat associated with the cat command. c. There is no effect until the alias is imported as it is a user-declared variable. d. When you use the cat command at the command prompt with the intention of viewing a text file the date appears instead.
When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead.
Which two implementations of X Windows are commonly used in Linux? (Choose two answers.)
X.org XFree86
Once X Windows is configured what command can be used to fine tune the vertical and horizontal refresh rate?
Xvidtune
Which command can be used to fine-tune the vsync and hsync of a video card for use in X Windows?
Xvidtune
How can you bypass the wait function and send a user process to the background?
You can use the Ctrl+z key combination and the bg command.
In order to download DPM packages what command should be used below?
apt-get
Which command can be used to remove the test DPM package including any test configuration files?
apt-get purge test
Select the two keywords that can be used in the lilo.conf file in order to specify where LILO should be installed and what parameters should be passed to the Linux kernel when loaded: ,
b. boot= c. append=
What is the name given to a process not associated with a terminal?
daemon process
A special construct used in a shell script to alter the flow of the program based on the outcome of a command or contents of a variable. Common decision constructs include if case, &&, and ||.
decision construct
Which of the following is not one of the three main types of Linux commands?
device calls
What command can be used to search for DPM package information?
dpkg-query
Which option to the rpm command can be used to remove a package from the system?
e
The default BASH shell prompt is set by an environment variable. What command can be used to view this variable?
echo $PS1
The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.) a. echo /HOME/ b. echo ~ c. echo ls HOME d. echo HOME=
echo ~ echo $HOME
In an if construct what statements are optional?
else elif
The variables that store information commonly accessed by the system or programs executing on the system together these variables form the user environment.
environment variables
Every if construct begins with if and must be terminated with? a. endif b. end c. fi d. stop
fi
The numeric labels used to define command input and command output.
file descriptors
What Systemd target corresponds to runlevel 5?
graphical.target
What is the default target on a system with a GUI installed?
graphical.target
What command below can be used to re-install GRUB2 in the event that the boot loader becomes corrupted?
grub2-install
You have recently modified the options within the /etc/default/grub file. What command can you use next to rebuild the GRUB2 configuration file?
grub2-mkconfig
To test DNS configuration by resolving a host name to IP address which command or commands can you use? (Choose all that apply.)
host hostname dig hostname nslookup hostname
Which of the following utilities can be used to check TCP/IP configuration and test network connectivity? (Choose all that apply.)
ifconfig ping netstat -i
Which command would be used to activate the NIC aliased as eth0?
ifup eth0
Which command causes the system to enter Single User Mode?
init 1
A runaway process that is faulty and consuming mass amounts of system resources ________.
is a rogue process
A special construct used in a shell script to execute commands repetitively. Common decision constructs include for and while.
loop construct
RPM packages that require other RPM packages to be installed on a system prior to being installed creates a relationship known as?
package dependency
Every process has a process ID and a_______.
parent process ID
The process of changing the default locations of Standard Input Standard Output, and Standard Error
redirection
Which command can be used to remove the RPM package file ?
rpm -e packagename
The environment variables that are set by default and their current values can be viewed with what command?
set
Which of the following Systemd commands can be used to stop a daemon called lala?
systemctl stop lala.service
Which of the following commands creates an archive?
tar -zcvf /dev/st0 *
Which command is used to delete a user account?
userdel username
Which command can you use to lock a user account?
usermod -L username
Which command would you use to unlock a user account?
usermod -U username
In order to change keyboard layout if X Windows can't detect the layout you should use what CLI command?
you should use what CLI command? , sys-config-keyboard
What yum command below can display a list of package group names?
yum grouplist
Which of the following commands can be used to search for packages that contain the word oobla on RPM software repositories?
yum search oobla
Which metacharacter is used to pipe the results of one command to another?
|
The first daemon loaded on a Linux system is _____.
Init
Which process will always have a PID of 1 and a PPID of 0?
Init
The GUI components and related software take up how much space on a typical Linux installation?
4 GB
What command can be used to configure the LILO ELILO, GRUB, and GRUB2 bootloaders? ,
Grubby
The first line in a shell script which defines the shell that will be used to interpret the commands in the script file.
Hashpling
What does >> accomplish when entered on the command line after a command? a. It redirects Standard Error and Standard Input to the same location. b. It redirects both Standard Error and Standard Ouput to the same location. c. It appends Standard Ouput to a file. d. It does not accomplish anything.
It appends Standard Output to a file.
Which command can be used to see processes running in the background?
Jobs
Which of the following statements is true?
LILO needs to be reinstalled after it has been modified.
What command looks for a Makefile and uses the information within to compile the source code into binary programs using the appropriate compiler program for the local hardware architecture?
Make
When compiling source code into a binary program which command does the compiling using the GNU C Compiler?
Make
You wish 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
To change the primary group temporarily to another group that is listed in the output of the groups and id commands you can use which command below? ,
Newgrp
Which command can be used to alter the primary group associated with a given user temporarily?
Newgrp
What is wrong with the following command string: ls /etc/hosts >listofhostfile ? a. Nothing is wrong with the command. b. The ls command is one of the commands that cannot be used with redirection you must use | to pipe instead. c. The file descriptor was not declared unless 1 for Standard Ouput or 2 for Standard Error is indicated the command will fail. d. The file listofhostfile will always only contain Standard Error as a file descriptor was not declared.
Nothing is wrong with the command.
The ____________________ environment variable contains a list of directories to search for executable programs
Path
You have redirected Standard Error 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? a. The system generated different Standard Ouput. b. After you open the file and view the contents, the contents are lost. c. You did not append the Standard Error to the Error file and as a result, it was overwritten when the command was run a second time. d. You must specify a new file each and every time you redirect as the system creates the specified file by default.
You did not append the Standard Error to the Error file and as a result, it was overwritten when the command was run a second time.
Select the test statement that can be used to determine if A is numerically greater than B:
[ A -gt B ]
Select the escape sequence that is used for a form feed:
\f
What is going to be the content of file1 after running the following command ? echo AbAdBd |tr "A" "a" > file1
abadBd
The killall command terminates _________.
all instances of a process with the same name
You can choose to use a window manager only and not use a desktop manager.
and not use a desktop manager. , True
Assume the following is the output out put of running the command cat file1 ( content of file1) Two h both alike in dignity, From forth THE fatal loins of THEse two foes Which, but their children's end, nought could remove, Do with THEir death bury THEir parents' strife. Which of the following command replacing "THE" with "the" ? ,ouseholds
cat file1 | sed 2,4s/THE/the/g
Assume the following is the output out put of running the command cat file1 ( content of file1) Two households both alike in dignity, From forth THE fatal loins of THEse two foes Which, but their children's end, nought could remove, Do with THEir death bury THEir parents' strife. Which of the following command removing the lines which contain a "THE" ?
cat file1 | sed THE/d
Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed?4 a. cd /home/user1 || cat "welcome home" b. echo "welcome home" && cd /home/user1 c. cd /home/user1 && echo "welcome home" d. cat "welcome home" || cd /home/user1
cd /home/user1 && echo "welcome home"
What two commands below can be used to modify the password expiry information and a user's default shell?
chage, chsh
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
What two window managers is the Compiz Fusion window manager based upon?
compiz beryl
A variable that is altered by loop constructs to ensure that commands are not executed indefinitely.
counter variable