Linux Final Exam
Linux Final Exam
Question 1
Which of the following is NOT a legitimate Linux command?
1) CP
2) ls
3) rmdir
4) RM
Question 2
Linux is ...?
1) the same as BSD
2) a kernel only.
3) based on NT4
4) used only in a server environment.
Question 3
I'm in my home directory and I want to create a new set of subdirectdories ~/foo/baz/bar. Which
single command would work?
1) rmdir -p ~/foo/bar/baz
3) mkdir -p foo/baz/bar
4) mkdir /foo/bar/baz
Question 4
I want to move the file 'file.txt' to its parent directory. I would use ...
1) mv ./file.txt /
2) mv file | find "parent directory"
3) mv ../parentdirectory
4) mv file.txt ..
Question 5
ssh uses what type of encryption?
1) elliptical curve
2) public/private key
3) symmetric
4) rot13
Question 6
The command to remove a directory is ...
1) rm -directory -i
2) remove <directory name>
3) rm -d
4) rmdir <name of directory>
Question 7
I entered the command "ls -al" and hit enter. Now I would like to repeat the command. Which of
these command would duplicate that command?
1) !
2) ls -l
3) !!
4) ls --repeat
Question 8
I want to see the last 10 commands I typed. What command would do this?
1) head 10
2) history | tail -n 10
1) is meaningless
2)
myhome is a shortcut or alias to /home/laurie
Question 11
The directories /sbin and /usr/sbin ...
(select the best answer)
Question 12
In Linux, everything is represented as a(n) ...
1) an executable file anyone can run
2) Piped filter
3) Executable
4) File
Question 13
The command pwd ...
Question 14
~/.foo (select the best answer).
1) Is a plain file
2) Is a binary executable
3) Is either a hidden directory or hidden file.
4) Is a directory under the root directory (/)
Question 15
The root folder is ...
1) /
2) /root
3) ~
4) /toor
Question 16
The command "cd ~" ...
1) Takes me to my home directory
2) Gives me an error message
3) Prints the current working directory
4) Changes to the /~ directory
Question 17
2)
Is used to find files matching a specific criteria, such as name, file size, file type,
etc.
Question 18
Typing '!23' and then hitting enter will do what?
3) print 23
Question 19
In order to run an executable from any location (directory) on your system... (select best answer)
1) Must be superman to run
2) the file must be in your path.
3) Must be in your working directory
4) Must be executed using the -x parameter
Question 20
I'm trying to think of the correct switches for a command, as a real Linux user you should:
1) Call Bill Gates
2) Call the Help Desk
3) Post a question to the "General Discussion" group
4) type "man <command>" from the shell
Question 21
The 'who' command .... (select the best answer)
1) Displays who I am (my user ID)
2) Doesn't exist
3) Doesn't exist, trick question!
4) Displays everyone who is logged in
Question 22
The operator '|' ... (select the best answer)
1) ls -R ~
4) ls -al
Question 24
The operator '>' (select the best answer)
1) Is used to chain commands together
2) Is used to append contents to a file.
3) Is used only with the bash history file
4) Redirects output
Question 25
Considering the command:
echo "hello world" >> file.txt.
The >> means ... (select the best answer)
1) Append "hello world" to the end of file.txt
2) Overwrite the file file.txt
3) Means "REALLY greater than"
Question 26
The command "less" ... (select the best answer)
1) is a mathematical operator
Question 27
The command "sudo" (select the best answer)
2)
Allows a user to run a command as root, as long as they are in the sudoers file, or
the admin group in /etc/group
Question 28
What is wrong with this command:
unmount /home/pc/tmp
Question 29
I'm a regular user, my present working directory is ~, and I have an executable named 'foo' in ~ I
would like to run. I would need to use which command?
1) foo
2) ./foo
3) foo -x
4) -exec foo
Question 30
I have a file name 'runme' owned by root with the following permissions:
-rwx rwx rwx
I want to change it so only root can rwx the file. What command does this?
Question 31
The command 'which <filename>'
1) Displays my path
2) None of these answers are correct!
3) Can only be run by root
4)
Returns the pathnames of the files that would be executed in the current
enviornment
Question 32
The command "jobs" (select the best answer from a Linux perspective)
1) Can only be run as root
2)
Displays the tasks and job numbers I have running in the background (issued
from the command line)
Question 34
wc -c file.txt
1) Shows the last modified time of the file
Question 35
I have a directory with 300 files in it. I would like to page through a list of these files from the
terminal. What command would allow you to do this?
1) ls | less
2) ls -page
4) ls > less
Question 36
What is the equivalent of this command?
less < doc.txt
2) cat doc.txt
Question 37
The command
sort <filename>
(select the best answer)
1) Must be used with the 'uniq' command
2) Must be run as sudo
3) sorts a filename by size
4)
sorts <filename> by line alphabetically, and displays the resulting output on the
screen
Question 38
Command line utility "finger" is used to:
1) List the IP addresses of users connected to local server
2) Find a list of users currently logged in
3) Send a message notifying others on the system that you just logged in
4) Kick a selected local user off the system (hence give the "finger")
Question 39
The command
head text.file
(select the best answer)
1) Won't work, you MUST use a number switch such as 'head -n10 text.file.'
2) Prints the first 5 lines of a file
3)
Prints the last 10 lines of a file
Question 41
My usb thumbdrive doesn't seem to mount. How do I find kernel information that might tell me
what the issue is?
Question 42
Which command allows you to view parent/child relationship of processes ?
1) ps -l
2) ps --show-all
3) pstree
4) treeme
Question 43
I have a hung process for a command. I want to stop the process. What do I do?
1) stop process
Question 44
What is the proper way to restart the sshd server?
1) kill -9 sshd
2) From the application server menu click on "File" and select "Exit"
3) Click the "X" button in the top right corner of the sshd application server
4) /etc/init.d/sshd restart
Question 45
I want to mount /dev/sdb1 on /mnt/super
Which command would do this, assuming /dev/sdb1 was formatted with the ext2 file system?
Question 46
The 'md5sum' command ...
Question 49
What is the purpose of the "fsck" utility ?
Question 50
I want to install the application 'vim' making sure I get the absolute most recent version. Which
command would do this?