HW#4 Flashcards
What is the purpose of conditional expressions in shell scripts?
A) They prevent scripts from executing if license conditions aren’t met.
B) They display information about the script’s computer environment.
C) They enable the script to take different actions in response to variable data.
D) They enable scripts to learn in a manner reminiscent of Pavlovian conditioning.
E) They cause scripts to run only at specified times of the day.
C
Which command would you type if you wanted to display your username from a Linux command line terminal shell?
A) he|p
B) uid
C) whereami
D) whoami
D
Which Linux directory usually holds the system
configuration files?
A) /etc
B) /boot
C) /usr
D) /home
A
Which file now stores user’s passwords in the Linux OS?
A) /etc/groups
B) /etc/passwd
C) /etc/shadow
D) /etc/user
C
Which of the following Linux command-line tools supports both gzip and bzip2 compression?
A) tar
B) zcat
C) archive
D) zip
A
____ files are those that control how the computer operates.
A) System
B) Boot
C) Shutdown
D) Archive
A
What are two forms of regular expressions used in Linux?
A) Basic
B) Extended
C) Hexadecimal
D) Alphanumeric
A and B
To have a script send an email automatically, which command would you use to do this?
A) mail
B) sed
C) awk
D) email
A
_____ are collections of programming functions that can be useful to many programs.
A) Libraries
B) Tarballs
C) Files
D) Subdirectories
A
You work as a Network Administrator for a company, and they have a Linux based network. You have created a script named if.cgi. You want to provide the following permissions on it:
rwsr-sr–
A) chmod 6754
B) chmod 2754
C) chmod 4754
D) chmod 7754
A
Which wildcard character can be matched for any one symbol in a filename?
A) ?
B) *
C) /
D) +
A
Which of the following would you use yum command to install or upgrade applications?
A) Red hat
B) Fedora
C) Unbutu
D) CentOS
A, B, and D
True or false: Many (not all) configuration files use a hash mark (#) to identify comment lines?
A) True
B) False
A
Which two keyboard characters can denote an account with no password?
A) @
B) *
C)»_space;
D) !
B and D
Which of the following redirection operators appends a program’s standard output to an existing file, without overwriting that file’s original contents?
A)»_space;
B) |
C) 2>
D) &>
E) >
A
Which of the following directories is where you would find the new mount point for removable media in the Linux OS?
A) /media
B) /mount
C) /run
D) /root
A
What is the filename extension for the bzip2 compression program?
A) .bz2
B) .bz
C) .2bz
D) .zb2
A
Which of the following type of user information might you find in the /etc/passwd file? (Choose three)
A) The UID
B) A detailed list of every group the user belongs
C) The users account home directory
D) The path to the users GUI desktop environment
E) The path to the users’ default text-mode shell
A, C, and E
True or false: To compress files archived with the zip command, you must use an external compression program such as gzip or bzip2 in a pipeline with zip.
A) True
B) False
B
True or false: The regular expression Linu[&c.circ;x].*lds matches the string. Linux Torvalds.
A) True
B) False
A
A ____is when the standard output from one program is redirected as the standard input to a second program.
A) Pipe
B) Stem
C) Tunnel
D) Tube
A
Which optional parameter would you use with the Linux sort command to ignore case sensitivity?
A) -f
B) -o
C) -i
D) -d
A
If you are in the Vi text editor command mode, which keystroke would you type to undo a change?
A) b
B) u
C) d
D) a
B
If you wanted to run/execute a script called my-script. what could you type in the Linux terminal shell to accomplish this?
A) grep a+x ./myscript
B) apt-get a+x ./myscript
C) chmod a+x ./my-script
D) su a+x myscript
C