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
Which of the following are the two major Linux package management systems?
A) RPM
B) BASH
C) DPKG
D) TAR
A and C
Which of the following syntaxes will you use to extract a file using the tar command?
A) tar-zvf {.tgz-file}
B) tar-zxvf {.tgz-file}
C) tar-cvff {.tgz-file}
D) tar-zwvf {.tgz-file}
B
Which of the following files would you search in order to obtain information about a user in a Linux OS?
A) /etc/passwd
B) /etc/shadow
C) /etc/users
D) /etc/linux/users
A
True or false: You can easily damage your Linux installation by mistyping an rm command when you log into your regular account.
A)True
B) False
B
Which of the following actions is performed when a file is uncompressed?
A) Extract
B) Execute
C) Remove
D) Archive
A
Which Linux command line tool would give you the following output?
mycc@mycc-ubuntu:-$ cd Documents
mycc(dmycc -ubuntu : ~/Document* $ ____ text .file
1 2 12 text.file
mycc@mycc-ubuntu:-/Documents$ []
A) wc
B) apt-get
C) nw
D) greP
A
What is the effect of the following short script, cp1, if it’s called as cp1 big.c.big.cc? #!/bin/bash cp $2 $1
A) It has the same effect as the cp command”copying the contents of big.c to big.cc.
B) It compiles the C program big.c and calls the result big.cc.
C) It copies the contents of big.cc to big.c, eliminating the old big.c.
D) It converts the C program big.c into a C++ program called big.cc.
E) The script’s first line is invalid, so it won’t work.
C
Which of the following statements would you need to include in a case statement to denote the end of the case statement?
A) eol
B) esac
C) end
D) ease
B
You want to run the following command inside your Linux terminal: iptables -L but know you will need to have root access to do so. If you are logged in under a basic user account, which command could you add to give you root access for just this command?
A) su iptables -L
B) root iptables-L
C) sudo iptables-L
D) admin iptables-L
C