Linux Midterm Quiz
Linux Midterm Quiz
gunzip hello1.tar.bz2
4) tar fz hello.tar.gz
Question 6
I run 'history' and see the following:
....
492 ls -al
493 clear
494 sudo cat /etc/passwd
495 ls -al
496 clear
I want to rerun the command:
sudo cat /etc/passwd
Which command would do this?
2) !!
3) 494$
4) !494
Question 7
I have a file named 'bigfile' in ~. I want to rename the file to 'oldfile', and I want to move it to
~/Downloads. The command that would do this is:
2) mv ~/bigfile ~/Documents/oldfile
3) mv ~/bigfile ~/Downloads/oldfile
Question 8
The 'who' command ...
1) Displays only power users
2) Doesn't exist
3) Displays who I am (my user ID)
4) Displays everyone who is logged in
Question 9
| (pipe) is used for what?
1) Is used to create little walls between things in Linux
2) Is used to concatenate files
3) Is used to chain commands together
4) Is always used with find or grep.
Question 10
Which of the following commands would find empty files (not directories) under /var/log only?
Question 13
I want to compress the file 'moNster.tar'. Which command would I use?
bzip2 moNster.tar
bunzip moNster.tar
bzip2 monster.tar
Question 14
I want to find all files under ~ that were modified less than 10 minutes ago. The command I run
would be:
find ~ -type f -cmin -10
True
False
Question 15
I want to search for files under ~ that contain the keyword "Flumox," and to redirect that output
to a new file called "Flumox.txt" under ~/Documents. The command would be:
find -name 'Flumox' > Flumox
Question 16
I'm in the following directory:
~/Docs/2015/dsc/linux/spring/night
If issue this command:
cd ../../../..
In what directory would I be?
~/Docs/2015/
~/Docs/2015/dsc/linux/
~/Docs/2015/dsc/
~/Docs/2012/
Question 17
I'm in my home directory and want to create the following directory hierarchy with one
command:
~/calculus/homework/june/2012
Which command would do this?
mkdir -r calculus/homework/june/2012
mkdir -p /calculus/homework/june/2012
mdir -p calculus/homework/june/2012
mkdir -p calculus/homework/june/2012
Question 18
I'm in the directory:
/var/log/mail/map/june/2012/calculus/hard/problems/yikes/do/not/want/to/fail/this/class/again
cd ~
cd -
cd ../../../../../../../../../../../../../../../
Question 19
I want to install the program "ruprecht" under Mint. Easiest way to do that is:
Can't be done in Linux.
atitutde update
atitude safe-upgarde
apropos delete
man delete
Question 23
I want to know what devices are mounted on my system. The best way to find out is to run:
umount
sufo fdisk -l
mount
Question 24
I want to find all regular files in my /var/log/mail directory with a '*.doc' extension that are
empty. What command would do this?
find /var/log/mail -name '*.txt'
man mkdir