Académique Documents
Professionnel Documents
Culture Documents
MIDTERM EXAM
Duration: 60 minutes
NO DOCUMENTS
--------------------------------------------
01. You need to find out which package owns a file called /etc/paper.config. Which command will
answer this question?
A. rpm -qf /etc/paper.config B. rpm –qa | grep /etc/paper.config
C. rpm -Fq /etc/paper.config D. rpm -q /etc/paper.config
E. rpm --requires /etc/paper.config
02. Which of the following TCP/IP network utilities is the BEST tool to use to establish if a given IP
address is reachable under the current network configuration?
A. ping B. finger C. route D. host
03. You detect a VIA USB controller in your computer. Which USB module would you load to use
this controller?
A. usb-via B. usb-ohci C.usb-uhci D.usb-intel E.usb-compaq
04. Which of the following directories may be placed outside the root partition?
A. /home B. /boot C. /var D./etc E./lib
05. Type the full command you could use to decompress the file "foo.gz"
A. gzip -d foo.gz B. gunzip -d foo.gz C. gunzip foo.gz D. unzip foo.gz
06. You want to compile and install a GNU software package, but you want to change the default
installation target. Which file would you edit?
A.config.h B. targets C. configure D.Makefile E. config
07. What file is used for associating port numbers to port names.
A. /etc/services B. /etc/hosts C. /etc/inetd.conf D. /etc/securetty E. /etc/ports
08. You want to deinstall a rpm packet foobar from your system. What would be a proper
command?
A.remove foobar B. remove foobar.rpm C.rpm remove foobar
D. rpm -e foobar E. deinstall foobar
09. Which command would you use to list all rpm-packets installed on your system?
A. rpm --all B. rpm --show-all C. rpm -q all D. rpm -qa E. rpm -la
10. Which of the following Linux utilities is used to update the user passwords stored in
'/etc/passwd' to utilize the more secure "shadow password" style.
A. passwd -s B. mkshadow C. shadowpw D. pwconv
11. Which of the following TCP/IP network utilities is BEST used to determine the hardware
ethernet address of the card(s) installed in the current machine?
A. netstat B. ifconfig C. ethers D. arpwatch
1
Linux HC – midterm Gv: Võ Tâm Vân
12. Which of the following command lines can be used to determine the list of modules that have
been compiled into the Apache web server?
A. ls /etc/httpd/modules/ B. httpd -l
C. apache --modules D. less /etc/httpd/conf/modules.conf
13. Which of the following files or directories is used to configure the local directories that are made
available remotely by an Network File System server?
A. /etc/fstab B. /mnt/nfs C. /etc/smb.conf D. /etc/exports
14. Your logfile shows repeated connections to TCP port 143. Which named service is being
accessed?
A. imap B.smbd C.nmbd D.pop2 E.smtp
16. Which is the command to delete the enviroment variable FOO from the current enviroment in
the bash shell?
A. delete $FOO B. destroy FOO C.unset FOO D.FOO= E.rm -rf $FOO
17. What is the file in which the default settings for shell variables are made for all users
A./etc/bash.conf B./etc/profile C./etc/bashrc D.~/.bash
19. Writing a shellscript you want to check if the file foobar exists. Which of
the following test commands will check only the existence of foobar?
A.test -d foobar B. test -e foobar C.test -b foobar D.test -x foobar E.test -f foobar
20. What set of files would be affected by the following wildcard? foo.*bar
A. foo.bar foo.1bar foo.2bar B. foobar foo.2bar foo.34bar
C. foo.1bar foo.2bar foo.Fbar D. foo.1bar foo.2bar Foo.3.bar
21. How many extended partitions could you create on one physical harddisk?
A. 1 B. 3 C.4 D.16 E. 64
22. How could you monitor the amount of free inodes on /dev/hda3 ?
A. inode --free /dev/hda3 B. ls -i /dev/hda3
C. du -i /dev/hda3 D. dm -i /dev/hda3 E. df -i /dev/hda3
23. Consider a mounted partition /dev/hdc7 is mounted on /mnt. Which command could be used to
unmount this filesystem?
A. umount /dev/hdc7 B. unmount /dev/hdc7 C. umount /mnt
D. unmount /mnt E. mount -u /dev/hdc7
24. User foo has left our company and you want to remove his account and all his files in his
homedirectory. Which of the following commands will do this?
A.rm -rf /home/foo B.userdel -r foo C.killuser foo D.deluser -r foo E.kill -HOME
2
Linux HC – midterm Gv: Võ Tâm Vân
25. You want to schedule jobs in regular intervalls. What system can be used for that purpose?
A.at B.cron C.schedule D.anacron E.regex
27. You want to transport a file named foo from one computer to another. The only media available
for transport are floppy-disks. Unfortunately the size of the file is about 10MBs. Which of the
following commands could you use to solve the problem?
A. cat --split 1.4M foo B. splitf 1440k foo C. split -b 1440k foo
D. cut -b1440k foo E. chunk --size=1440k -f foo
28. What command shows you, what groups you belong to?
A.whatgrp B.whatgroup C. group D.groups E.grps
30. Your network has a network address of 172.16.170.0/23. What are valid host addresses in your
network?
A.172.16.171.0 B.172.16.170.255 C.172.16.171.255
D.172.16.171.171 E. 172.16.170.0
31. Which of the following programs are valid display managers for X11?
A. xdisplaymanager B. xdm C. gtkm D. gdm E. kdm F. fdm
32. Which of the following commands results in mailing the content of the current directory to Bob?
A. mail Bob < ls B. ls > mail Bob C. ls || mail Bob D. ls | mail Bob E. mail Bob ls
33. How could you get the number of all accounts on your system, including admin and system
accounts?
A. numusers -r B. wc -l /etc/passwd C. count --lines /etc/passwd D. userinfo -n
34. You have to move the whole directory-tree /home/foo to /oldusers. What command would you
use?
A. move /home/foo /oldusers B. mv /home/foo /oldusers C. mv -r /home/foo /oldusers
D. mv -R /home/foo /oldusers E. cp --move /home/foo /oldusers
35. How can you detect, which PCI devices are connected to your computer?
A. Using the readpci command B. Using the lspci command C. Using the
getpci command D. Using the pci_info command E. Using the file /proc/pci
36. You want to install the tarball foobar.tar.bz2. What command would unpack the achive?
A. tar x foobar.tar.bz2 B. untar foobar.tar.bz2 C. tar tzvf foobar.tar.bz2
D. tar xjf foobar.tar.bz2 E. bzcat foobar.tar.bz2 | tar xf –
3
Linux HC – midterm Gv: Võ Tâm Vân
37. How could you monitor the amount of free inodes on /dev/hda3 ?
A.inode --free /dev/hda3 B. ls -i /dev/hda3 C. du -i /dev/hda3
D. dm -i /dev/hda3 E. df -i /dev/hda3
38.You are instructed to create an NFS share on one of the MAketing file server.Which file on the
server should you modify?
A. /etc/exports B./etc/nfs.conf C./etc/export D./etc/expnfs
43. How could you display any line of text from the file foo which starts with an upcase letter?
A. grep "^[A-Z]" foo B. grep "[A-Z]" foo C. grep "$[A-Z]" foo D. grep [A-Z] foo
44. You want to list the contents of the directory “directory1” with any errors going to the file
“error1”. How would you do this?
A. ls directory1 0>error1 B. ls directory1 2>error1
C. ls directory1 >error1 D. ls directory1 1>error1
45. You want to stop the inetd process immediately. It has a process id of 15. How would you do this?
A. kill -9 15 B. kill -15 9 C. kill -1 15 D. kill -3 15
47. You want to locate all files that were accessed more than 3 days ago. How would you do this?
A. find / -time -3 B. find / -atime -3 C. find time 3d D. find time 3
48. What command would you use to stop one of the processes if it didn't have an init script to do it
for you?
A. stop B. end C. more D. kill
49. Which command can you use to create an empty file without opening it in an editor?
A. vi B. more C. touch D. make
50. What would you type to mount an MS-DOS formatted floppy (without relying on /etc/fstab
shortcuts)?
A. mount /mnt/floppy B. mount -t msdos /mnt/floppy /dev/fd0
C. mount /dev/fd0 /mnt/floppy D. mount -t vfat /dev/fd0 /mnt/floppy
4
Linux HC – midterm Gv: Võ Tâm Vân
53. Which command would a user type to edit his or her automated jobs?
A. vi crontab B. cronedit C. crontab –e D. cron --edit
54. How could you help users to create files with serious file permissions?
A. Change the user's directory permissions
B. Use a serious umask setting in the user's profile
C. Use cron to change the file permissions of the users files once a day
D. Use replacements for the standard unix tools which create secure files
55. You have a text file named mytextfile. How would you sort the lines of file in reverse alphabetical
order?
A. sort –a mytextfile B. sort mytextfile
C. sort –r mytextfile D. sort –ra mytextfile
56. You want to number the lines of a file called hotstocks. How would you do this?
A. number hotstocks B. sed –n hotstocks C. nl hotstocks D. vi –nl hotstocks