Midterm Exam (Ch1-14)
-
Bash is:
- a networking term
- a shell
- an operating system
- a website
-
The two login types are:
- URI and CLU
- CLI and GUI
- GUX and CLI
- URI and CLI
-
A software release cycle describes:
- How often the computer must be upgraded to support new software
- How often the computer must be rebooted
- How often upgrades come out to software
- The often security fixes are implemented
- How often the software’s memory is released back to the operating system
-
Which Linux distributions are derived from Red Hat?
(choose two)
- CentOS
- Slackware
- Ubuntu
- Debian
- Fedora
-
Bundling utilities, management tools, and application software with a Linux kernel is called a:
- A trademark
- A text editor
- A type of hardware
- A distribution of Linux
-
To display your current location within the filesystem, you can type:
- cwd
- pwd
- dir
- whereami
-
A command can take the form of:
(choose three)
- A configuration file
- A block
- A program built-in to the shell
- An alias
- A function
- A variable
-
You want to execute the
ls
command with two options:-r
and-l
. Which of the following are valid ways to run this command:(choose three)
ls -r -l
ls rl
rl ls
ls -l -r
ls --r --l
ls -rl
-
You can pass arguments to long options by using which of the following techniques:
(choose two)
- –option~argument
- –option argument
- –option=argument
- –option{argument}
-
When typing a command, you can have the bash shell complete the command by pressing which key?
- The Enter key
- The Del key
- The Backspace key
- The Tab key
- The Up Arrow key
-
Long command options are preceded by which two characters?
**
--
||
&&
-
Which command is used in order to view the manual page for a topic?
-m
-x
show
doc
man
-
The ______ command will display your current working directory.
exit
uname
pwd
exec
-
To see a list of commands that are available while viewing a man page, you can type the __ character.
- c
- g
- w
- h
-
Environment variables are:
- Not used by shells at all
- Are not a valid type of variable
- Only available to the shell they are created in
- Passed into other shells and commands
-
If you want to delete a variable, you can run:
wipe
unset
clear
delete
-
Local variables are:
- Not used by shells at all
- Are not a valid type of variable
- Passed into other shells and commands
- Only available to the shell they are created in
-
ion ID 2336
- Shell variables are used to:
- Hold critical system information
- Hide passwords
- Prevent users from logging in
- Reboot the system
-
The
/bin
directory contains:- Nothing; it is not a valid directory
- Essential administrative commands
- The most fundamental commands that are essential for the operating system to function
- Commands that have been compiled from local sources
-
The
/sbin
directory contains:- Nothing; it is not a valid directory
- Commands that have been compiled from local sources
- Essential administrative commands
- The most fundamental commands that are essential
-
To view all current variables, you can use:
var
view
dump
set
-
Which file can you place in your home directory to be executed when you log off the system?
/etc/bashrc
~/.bash_profile
~/.bash_logout
~/.bashrc
-
Which of the following files is for all bash shell users and executed every time a bash shell is opened?
- ~/.bashrc
- /etc/bashrc
- /etc/profile
- ~/.bash_profile
-
Which of the following files is for all bash shell users and executed only at login?
- /etc/bashrc
- /etc/profile
- ~/.bashrc
- ~/.bash_profile
-
Which of the following will create a variable?
- variable~value
- variable value
- variable=value
- variable+value
-
Which of the following is not used for globbing?
*
?
#
[ ]
-
Which command will display more information about globbing?
man globbing
man 7 globbing
man 7 glob
man -7 glob
-
The glob pattern
[a-d]
would match:- All files
- A file name with a single character that is either an a, -, or d.
- A file name with a single character that is either a a, b, c, or d.
- Nothing, this is an invalid glob pattern.
-
Use the ___ option to display hidden files with the ls command.
- -h
- -a
- -D
-
The
ls
command can list the contents of only one directory at a time.True or False?
- True
- False
-
The period
.
character in the output of thels
command represents:- Hidden files
- The end of the command output
- The current directory
- Directories that can’t be accessed
-
To perform a long listing to show file details, use which of the following commands:
- ls -l
- ll
- ls -L
- ls -D
-
To copy the contents of a directory, use the following option(s) for the
cp
command:(choose two)
-r
-A
-R
-d
-
The
mv
command can be used to move more than one file at a time.True or False?
- True
- False
-
The
mv
command will rename a file when a new directory is not specified.True or False?
- True
- False
-
The
rmdir
command can be used to delete directories and their contents.True or False?
- True
- False
-
Which character at the beginning of a long listing indicates a directory?
- d
- c
- l
- –
-
Which of the following are advantages of using the
find
command?(choose two)
- It is quicker than the locate command
- Its results are always the most up-to-date
- It pages the results
- It can search by file attribute types
-
The FHS sets which standard?
- Which filesystem types should be used
- Which partitions should be created
- Which directories should be used to hold specific files
- Which services should be installed
-
What directory is used as a temporary mount point?
- /tmpmnt
- /xbin
- /mnt
- /etc
-
Which option to the
find
command will search by user owner?- -uowner
- -owner
- -user
- -person
-
Which directory represents the root of the filesystem hierarchy?
- /etc
- /var
- /
- /root
-
Which directory is used to store user home directories?
- /home
- /usr
- /homedir
- /tmp
-
Which directory is used for the home directory of the root user?
- /
- /root
- /var
- /home
-
If you want to see the entire contents of a text file, you can use the _____ command:
type
cat
wc
cut
-
The
head -n -1 readme.txt
command will:- Display all but the first line of readme.txt
- Number the first line of readme.txt
- Display the first line of readme.txt
- Display all but the last line of readme.txt
-
Which command will merge two files together line by line?
join
merge
combo
paste
-
If you want to break apart a large file into smaller files, you can use:
dump
split
cat
break
-
If you want a file to be displayed with its lines numbered, you can use:
nc
nl
fmt
cut
-
Which of the following commands can be used to scroll through a text file?
head
sed
less
cat
-
The regular expression
a*
is equivalent to:- a{0,}
- a{1}
- a{0,1}
- a{1,}
-
To use extended regular expressions, you can use:
(choose two)
grep -e
egrep
grep -E
fgrep
-
What does the vertical bar
|
character do in a regular expression?- Redirects input to the command
- Redirects output from the command
- Separates alternative patterns that can be matches
- Separates repetition modifiers
-
What is not a purpose of using parentheses around parts of a regular expression?
- They can be used to make alternation more efficient
- They can be used to refer back to what was matched
- They can be used to change the order that the pattern is evaluating
- They can be used to group characters for repetition
-
Which of the following regular expression characters is an extended regular expression character?
- .
- +
- $
- *
-
Which regular expression character matches any one character?
- +
- *
- .
- ?
-
If you are in the
vi
command mode and want to begin inserting text before your cursor, you can type:- O
- i
- A
- o
-
If you are in
vi
command mode and want to add a new line after your cursor, you can type:- O
- i
- o
- a
-
If you want to move a character to the right in
vi
command mode, you can press the Right Arrow Key → or:- k
- l
- j
- h
-
To go to the first line of a
vi
document in command mode, you can type:(choose two)
- 1G
- G
- gg
- GG
-
To perform cut and paste in a
vi
document, you actually do:- delete and put
- yank and put
- delete and yank
- yank and paste
-
To save and then quit, you can type in command mode:
- WW
- ZZ
- !!
-
If you want to append content to a file with the normal output of a command, you can use:
- 1>
- >
- >>
- 2>>
-
This stream is the output of a command operating normally:
- stdout
- stdin
- stdnorm
- stderr
-
Two or more commands combined with the vertical bar
|
character between them form a:- pipeline
- streamline
- outputline
- command line
-
Which command can be used to send the output of a command to both stdout and a file:
ls | tee /tmp/output.txt
ls 2 | /tmp/output
ls | echo /tmp/output.txt
ls | /tmp/output.txt
-
A popular program for monitoring running processes in real-time is:
top
ghost
mon
watcher
-
The
uptime
command prints a statistic representing the system load over what three time spans?(choose three)
- Last ten minutes
- Last five minutes
- Last minute
- Last fifteen minutes
- Last hour
- Last thirty minutes
-
The _____ command will list the commands that are running in your terminal.
proc
ps
ls
list
-
The key press combination that will request a process to stop is:
- CTRL+C
- CTRL+P
- CTRL+Z
- CTRL+D
-
To change the niceness value of an existing process, you can use the _____ command.
renice
reset
set
nice
-
To execute a command with the default priority, which value do you pass to the
nice
command?- 19
- 20
- -20
- 0
-
To see how long the system has been running, you can use the _____ command.
nice
free
uptime
ps
-
To see the list of background processes that you have started in your shell, you can run:
process
jobs
list
work
-
To send a signal to a set of processes with the same name, you can run:
sigkill
allkill
grpkill
killall
-
To view statistics on memory availability, you can use:
free
mem
stat
uname
-
Using the
kill
command always terminates processes.True or False?
- True
- False
-
By default,
tar
will attempt to extract an archive…- to the specified directory.
- into the archive’s parent directory.
- into the working directory.
- into the user’s home directory.
-
The
dd
command can be used to copy entire partitions.- False
- True
-
To decompress the archive
example.gz
, use the following command:gzip -u example.gz
gunzip -x example.gz
gzip -x example.gz
gunzip example.gz
-
Which of the following commands could be used to extract the archive,
example.tar
?tar -uz example.tar
tar -uf example.tar
tar -xf example.tar
tar -xz example.tar
-
Which option to the
zip
command will list its files without uncompressing them?- -l
- -d
- -R
- -r
-
For the
rwxr-x--x
permission set, the highlighted permissions belong to:- The user owner of the file
- All users besides the user owner and group owner
- The user owner and group owner of the file
- The group owner of the file
-
The command,
chmod u=g
will:- Set the user owners permissions to match the group owners permission
- Set the group owners permissions to match the user owners permissions
- Set the user owners permissions to rwx
- Nothing, the command syntax is invalid
-
The group ownership of a file may only be changed by:
- Any user can change the group ownership of any file
- The root user
- The owner of the file
- Both the root user and the owner of the file
-
The only person who can change the user ownership of a file is:
- The root user
- Any user can change the group ownership of any file
- The owner of the file
- Both the root user and owner of the file
-
The setuid permission on a file:
- Causes the file to run under the owner’s identity
- Causes the file to never run as root
- Causes the file to run under the user’s identity
- Causes the file to always run as root
-
To run a script file, you need both read and execute permission.
True or False?
- True
- False
-
Which command can be used to set what your default permissions will be on new files?
mode
umode
umask
mask
-
Which command can change the user owner of a file?
own
chown
pawn
chpawn
-
Which command is used to change permissions on a file?
chmod
chperm
chgperm
chgmode
-
Which commands can be used to change the ownership of a file?
(choose two)
chown
chgrp
chggrp
newgrp
-
Which command will allow you to change the group ownership of a file that you own?
chgrp
regroup
chmod
chown
-
Which permission, when set on a directory, causes new files and directories that are created inside to be owned by the group that owns the directory?
- write
- setgid
- setuid
- sticky bit
-
What permissions are typically placed on soft link files?
rw-rw-rw-
---------
rwxrwxrwx
rwx------
-
Which are valid link types in Linux?
(choose two)
- Stable links
- Hard links
- Filesystem links
- Soft links
-
Which type of link can be made to directories, hard or soft?
- soft
- hard
Subscribe
0 Comments
Newest