50% found this document useful (2 votes)
684 views

Linux Final Exam

This document contains 49 multiple choice questions about various Linux commands and concepts. The questions cover topics such as file manipulation commands like cp, ls, rmdir; Linux fundamentals like what Linux is and the /proc directory; user management commands like sudo and who; process monitoring commands like ps and jobs; I/O redirection operators like | and >; and other utilities like find, less, sort, and md5sum.

Uploaded by

Super Rage
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
684 views

Linux Final Exam

This document contains 49 multiple choice questions about various Linux commands and concepts. The questions cover topics such as file manipulation commands like cp, ls, rmdir; Linux fundamentals like what Linux is and the /proc directory; user management commands like sudo and who; process monitoring commands like ps and jobs; I/O redirection operators like | and >; and other utilities like find, less, sort, and md5sum.

Uploaded by

Super Rage
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Linux Administration 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

2) mkdir -rf 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

3) head 10 > history


4) history | letmeseelast 10
Question 9
Which directory in Linux contains information for all processes running on your system?
1) sysinfo
2) /proc
3) computer
4) process
Question 10
You run "ls" and see the following:
myhome -> /home/laurie
What does this mean?

1) is meaningless
2)
myhome is a shortcut or alias to /home/laurie

3) /home/laurie is an alias to 'myhome'

4) Means Laurie is at home.

Question 11
The directories /sbin and /usr/sbin ...
(select the best answer)

1) Contains mail files

2) Contain executables that only someone running as superuser can execute

3) Contain configuration files only

4) DO NOT EXIST! TRICK QUESTION!

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 ...

1) Resets ROOT's password

2) Prints the present working directory


3) Resets your password
4) Doesn't exist! Trick question!

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

The command "find"...

1) Is used to find your way back home.

2)

Is used to find files matching a specific criteria, such as name, file size, file type,
etc.

3) Is used to find keywords within a file

4) Does not exist in Linux

Question 18
Typing '!23' and then hitting enter will do what?

1) it will erase the 23rd command from your history

2) kill the 23rd process running on your system

3) print 23

4) execute the 23rd command from your bash history file

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) Must be run with sudo to work

2) Is used to separate root based utilities


3) Is used to create little walls between things in Linux
4) Is used to chain commands together
Question 23
I want to see a recursive directory listing of all files and directories under my home folder. The
correct command to use would be:

1) ls -R ~

2) There is no such command that can do this.

3) ls -al > ./hello

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"

4) The >> operator doesn't exist, trick question.

Question 26
The command "less" ... (select the best answer)

1) is a mathematical operator

2) allows a user to page through a file

3) is the same as vim

4) is used to chain commands together

Question 27
The command "sudo" (select the best answer)

1) Allows the user to login as root

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

3) Means switch user, not changing the path


4) Is the same as running the command 'su'.

Question 28
What is wrong with this command:
unmount /home/pc/tmp

1) There is no 'unmount' command. Should be 'umount'.

2) Need to change the owner of the file


3)
You need to change the permissions on the exectuables

4) Nothing is wrong, that should work.

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?

1) chown root rwx

2) sudo chmod 700 runme

3) chmod 750 runme

4) chmod 700 runme

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)

3) Is the CEO of Apple


4) Does not exist, that's a BSD command
Question 33
Which of the following will search for the keyword 'help' in all files under all of the
subdirectories under ~/Documents?

1) grep help ~/Documents

2) grep help ~/Documents/*

3) grep -r help ~/Documents

4) None of these are correct!

Question 34
wc -c file.txt
1) Shows the last modified time of the file

2) Returns the process id of file.txt


3) Returns in the number of lines in file.txt
4) Returns in the number of bytes (charactes) in file.txt

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

3) ls < cat > less

4) ls > less

Question 36
What is the equivalent of this command?
less < doc.txt

1) doc.txt < cat > sudo

2) cat doc.txt

3) less > doc.txt


4)
less 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

4) Prints the first 10 lines of a file


Question 40
The command "tail text.file" does what?

1) Prints the last 5 lines of a file

2) Prints the first and last 10 lines of a file

3) Prints the last 10 lines of a file

4) Prints the first 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?

1) sudo grep 'usb' | find -type f -size +10 -exec

2) sudo force | mount usb

3) who | tail 'usb'

4) dmesg | grep usb

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

2) sudo kill -9 <process ID, whatever it is>

3) sudo pstree | less

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?

1) mount /dev/sdb1 /mnt/super

2) sudo mount -t ext2 /dev/sdb1 /mnt/super

3) umount -t ext2 /dev/sdb1 /mnt/super

4) mount -t auto /sdb1 /mnt/super

Question 46
The 'md5sum' command ...

1) generates two-way cryptographic hash of a file

2) creates a one-way cryptographic hash of a file

3) creates an 'md5' file system

4) creates a swap file


Question 47
Which command will show your current kernel's official release date/time ?
1) top
2) uname -v
3) date -R
4) ncal -p
Question 48
I want to update my systems date/time. I can run:

1) sudo date ntpupdate

2) sudo ntpdate ntp.ubuntu.com

3) sudo date update

4) cat date < ntp.ubuntu.com

Question 49
What is the purpose of the "fsck" utility ?

1) It is a command line spyware removal utility for PC running Linux

2) It keeps track of the filesystems

3) It checks and repairs problems (if found) on the filesystem

4) It partitions specified hard drive or floppy

Question 50
I want to install the application 'vim' making sure I get the absolute most recent version. Which
command would do this?

1) sudo install aptitude vim

2) sudo aptitude install vim

3) sudo aptitude update && sudo aptitude install vim

4) sudo install vim

You might also like