ÔN TẬP LINUX

Ke ndy_kieu

(sưu tầm)

1.What is the most popular file system choice? A. ext2 B. bsdf C. jfs D. ext3 Answer: A 2.What ste ps need to be pe rformed, to make a ne w disk accessible to users? Select three. A. fdisk B. mkfs C. mount D. stat E. quotaon Answer: A, B, C 3.Whic h THREE of the following comma nds are used whe n setting up and accessing a ne w filesystem on the ha rd drive? A. fsc k B. mkfs C. mount D. fdisk E. format Answer: B, C D 4.The command mkfs -t ext3 /dev/hdb1 - T largefile creates what size of inode ? A. 4 kilobyte B. 1 megabyte C. 2 megabyte D. 4 megabyte Answer: B 5.Whic h command will show the number of free and used inodes for your system's mounte d file systems? A. du -i B. df -i C. ls -iR / D. freeinodes Answer: B 6.How many inodes are assigned to a file when it is created? A. 1 B. 2

C. 4 D. 8 Answer: A 7.What command with switc hes will display the disk utilization for all mounte d file systems? A. df B. vmstat C. du D. top E. free Answer: A 8.What command with options will show the c urrently mounted filesystems usage in kilobytes? A. df - k B. df -h C. du - k D. du -h E. du -s Answer: A 9.Whic h of the following commands will print the inode usage on eac h mounte d filesystem? A. du -i B. df -i C. lsfs -i D. printfs -i Answer: B 10.You need to create a symbolic link in the c urrent user's home directory named Certkiller to the file /data/foobar. Choose the command that will accomplish this. A. link . Certkille r /data/foobar B. ln /data/foobar $HOME/ Certkiller C. ln -s /data/foobar ~/ Certkiller D. file --link ./ Certkiller /data/foobar E. None of the above Answer: C 11.Which chown command will c hange the ownership to foo a nd the group to bar on a file named biglist? A. chown foo/bar biglist B. chown -u foo -g bar biglist C. chown foo:bar biglist D. c hown --user foo --group bar biglist Answer: C 12.You have the following file: -rwxrwxr-x 1 foo root 0 Feb 23 07:48 /bin/foo Which of the following commands will c hange the owne r of the file /bin/foofrom the foo userto the bar use r without affecting group ownership? A. chown /bin/foo bar

B. chown bar /bin/foo C. chown bar.foo /bin/foo D. c hown.foo.bar /bin/foo Answer: B 13.Which of the following commands ma kes /bin/foo executa ble by everyone but only writable by its owner? A. chmod 557 /bin/foo B. chmod o +rwx, a+rx /bin/foo C. chown 557 /bin/foo D. c hmod 755 /bin/foo Answer: D 14.You need to alte r the permissions on the directory /home/mrbill and all it's contents to matc h the following permissions. drwxr--r-- Whic h of these commands with options and arguments will accomplish this? Choose two. A. chmod 0744 /home/mrbill - R B. chmod 744 /home/mrbill/* C. chmod -R u=rwx,g=r,o=r /home/mrbill D. c hmod u+rwx,g+r,o+r /home/mrbill Answer: A, C 15.What umask will set the file pe rmissions on a ne wly created file to -rw-r--r-- (644)? A. 0002 B. 0022 C. 0224 D. 0246 Answer: B 16.You want the de fault permissions for your files to be -rw-r----- . HOW must you set umask? A. 037 B. 640 C. 038 D. 027 Answer: A 17.After creating a ne w file, you notice that the permissions of the ne w file are -rw-rw-rw-. F rom this, you know that the value of the umask is what? A. 023 B. 000 C. 112 D. d111 E. 223 Answer: B 18.What are the de fault permissions for the Red Hat /etc/passwd file? A. 644

B. 640 C. 400 D. 641 E. 440 Answer: A 19.Which of the following are required in the /etc/passwd file when creating a user account? (C hoose all that apply) A. login name B. userid C. default group D. password age E. minimum password length Answer: A, B, C 20.Which file contains information about filesystems and the ir respective mount points? A. /etc/mount B. /etc/fs_mount C. /etc/fstab D. /proc/fstab Answer: C 21.Which of the following programs can be used to the find the foo program in the.PATH and associated man pages, but not list every file containing foo on the system? A. which B. search C. slocate D. whe re E. whe reis Answer: E 22.What command can be used to cause changes to the inittab file to take effect without a system reboot? A. init q B. init r C. inittab r D. inittab q Answer: A 23. Whic h of the following is a journaling filesystem? A. ext2 B. vfat C. minix D. ext3 Answer: D 24. The first ethe rnet card on a system is: A. eth0 B. etho0 C. eth1 D. hme0 Answer: A 25. You can find all of the services manage d by xinetd by looking at whic h of the following file or directory? A. /etc/xinetd.d B. /etc/inetd.conf C. /etc/rc.d/init.d D. /etc/xinetd.conf Answer: A 26.What partition number always refe rs to the first logical partition?

A. 0 B. 4 C. 1 D. 5 Answer: D 27.Which of the following files specifies information on what is NF S shared on your system? A. /etc/exports B. /etc/dfs/dfstab C. /etc/fstab D. /etc/sharetab Answer: A 28. What command could be used to find out which pac kage owns the f ile /etc/aliases? A. rpm -qf /etc/aliases B. rpm -qp /etc/aliases C. rpm -e /etc/aliases D. rpm -qil /etc/aliases Answer: A 29. Whic h of these c ommands will list PC I devices? A. lsdevices B. lspc i C. lsdev D. pcidev Answer: B 30. What command could be used to find all pac kages with the string 'mail' within the pac kage name? A. find / -name '*mail*' B. rpm -qf /usr/bin/mail C. rpm -qa | gre p ma il D. locate mail Answer: C 31. On a system with 16MB RAM, the minimum size of your swap pa rtition should be equal to how many MBs? A. 16 B. 32 C. 64 D. 100 Answer: B 32. On a ne w Linux installation, the partition mounted on where conta ins the operating system kernel? A. /boot B. /dev C. /kernel D. /bin Answer: A 33. A Linux server installation re quires how many GB of free space for a minimal insta llation whe re no graphical display is ever needed? A. 0.8 B. 0.5 C. 1.1 D. 1.5 Answer: D 34. When init starts, it first runs which of the following sc ripts? A. /etc/rc.d/rc.sysinit B. /etc/rc.d/rc.sysinit0 C. /etc/rc.d/rc.sysinit1 D. /etc/rc.d/sysinit0 Answer: A 35. What file contains the default env ironment variables when using the bash shell? A. ~/.profile B. /bash C. /etc/profile D. ~/bash Answer: C 36. What is the usual mode for the /tmp directory? A. 0777 B. 0755 C. 7777 D. 1777 Answer: D 37. The netstat –r command produces the following output: 192.168.10.0 * 255.255.255.0 U 40 0 0 eth1 Which of the following best describes this line?

networks.

A. 192.168. 10. 0 IS A Gate way (G) to all exte rna l B. the host, 192.168. 10.0, is curre ntly up (U). C. There are c urrently 40 pac kets waiting for transmission ove r this route.

D. The network, 192.168.10, is accessible through the local NIC configured as eth1. Answer: A 38. All of the following commands ca n be used to dete rmine open TCP ports an localhost EXCEPT: A. lsof B. netstat C. nmap D. fuse r E. ifconf ig Answer: E 39. How would you display your system‟s c urrent ARP cache? A. arp –a B. netstat –a C. netstat –arp D. cat /ect/arp Answer: A 40. Your organization has ope ned a ne w office on a differe nt floor, and the compute rs that will be installed the re will be on a ne w network, 192.168. 1.0/24. A Linux gate way having the address 192.168.0.2 on your local network will route tra ffic between the two subnets. Which invocation of the „route‟ command will properly reconfigure your firewa ll (address 192.168.0.1) so that it can communicate with the ne w subnet? A. route add 192.168. 1.0/24 192.168.0.2 B. route add . net 192.168.1.0 netmask 255.255.255.0 gw 192. 168.0.2 C. route add 192.168.1.0 netmask 24 gw 192.168.0. 2 D. route add –net 192.168.1.0/24 192.168.0.2/32 E. route add 192.168.1.0/255.255.255.0 gw 192.168.0.2 Answer: E 41. You have created special configuration files that you want copied to each user‟s home directories when c reating a ne w user accounts. You copy the files to /etc/skel. Which of the following commands will make this happen? A. use radd –m use rname B. useradd –mk username C. useradd –k username D. useradd –Dk username Answer: B 41. You have ente red the following cronjob. When will it run? 15 * * * 1. 3. 5 myscript A. At 15 minutes after every hour on the 1st, 3rd and 5th of each month. B. At 1:15 am, 3:15 am, and 5:15 am every day. C. At 3:pm on the 1st, 3rd, and 5th of each month. D. At 15 minutes after every hour every Monday, Wednesday, and F riday. Answer: D 42. You need to search the entire directory structure to locate a specific file. How could you do this and still be able to run other commands while the find command is still searching for you file? A. find / -name file name & B. find / -name file name C. bg find / -name filename D. &find / -name filename & Answer: A 43. To allow a user to mount a C D and read from it, whic h entry should be put into /etc/fstab? A. /dev/cdrom /mnt/cdrom iso9660 noauto,use rmap,ro 0 0

B. /dev/cdrom /mnt/cdrom iso9660 noauto,uid=user,gid=group,ro 0 0 C. /dev/cdrom /mnt/cdrom iso9660 noauto,User, ro 0 0 D. /dev/cdrom /mnt/c drom iso9660 noauto,user,ro 0 0 Answer: D 44. You have to mount the /data filesystem from an NF S se rver (srv 1) that does not support loc king. Whic h of the following mount commands should you use? A. mount –a –t nfs B. mount –o loc king=off srv1:/data /mnt/data C. mount –o nolock srv 1:/data /mnt/data D. mount –o noloc k/data@srv 1 /mn/data Answer: C 45. You want to c heck what shares are offered by a Windows system. Which of the following commands could you use to pe rform this task? A. mmblookup B. showshares C. smbc lie nt D. smbstatus E. listshares Answer: C 46. How can you dete rmine who has scheduled at jobs? A. at –l B. at –q C. at –d D. atwho Answer: A 47. Using command substitution, how would you display the value of the present working directory? A. echo $(pwd) B. ec ho pwd C. $pwd D. pwd | echo Answer: A 48. Whic h of the following environment variables determines your working directory at the completion of a successful login? A. HOME B. BASH_ENV C. PWD D. BLENDERDIR Answer: A 49. Whic h of the following daemons must be running on a n NF S se rver? A. portmap B. nfsiod C. nfsd D. xinetd E. mountd Answer: AC 50. Whic h process had the Process ID number 1? A. bash B. ke rne l C. init D. none Answer: C 51. You issue the command jobs and receive the following output: [1]- Stopped (tty output) pine [2]+ Stoppe d (tty output) MySc ript How would you bring the MyScript process to the foreground? A. fg % 2 B. ctrl-c C. fg MySc ript D. ctrl-z Answer: A 52. On a system with separate partitions for /, /usr, /var, /tmp which filesystem[s] can safe ly be mounted read-only? A. /var, /usr B. /var C. /usr, /, /tmp D. /usr E. /tmp Answer: D 53. What file will show you the IRQs being used by different hardware devices? A. /proc/inte rrupts B. /proc/irqs C. /proc/irq D. /proc/int E. /proc/ints Answer: A 54. What is wrong with the following command? tar cvfb //dev/tape 20

A. You cannot sue the c option with the b option. B. The correct like should be tar –cvfb /dev/tape 20. C. The arguments are not in the same order as the corresponding modifiers. D. The files to be bac ked up have not bee n spec ified. Answer: C 55. How would you find out the version of the ke rne l in /usr/src/linux? A. cat /usr/src/linux/.version B. cat /usr/src/linux/VERSION C. Look in the README D. head –4 /usr/src/linux/Make file Answer: D 56. On a running system, where can you find spec ific information about the partition tables, such as major and minor device numbers, and n umbe r of bloc ks? A. /proc/partitions B. /proc/cpuinfo C. /proc/fstab D. /etc/partitions E. etc/fstab Answer: A 57.What option is used with the useradd command to specify the use r's home directory? A. -d B. -h C. -u D. -a Answer: A 58.What switch is used with the usermod command to change a use r's secondary groups? A. -G B. -group C. -d D. - U Answer: A 59.Which of the following are required in the /etc/passwd file when creating a user account? (C hoose all that apply) A. login name B. userid C. default group D. password age E. minimum password length Answer: A, B, C 60.What run level represents basic multi-use r? A. 2 B. 0 C. 1 D. 5 Answer: A 61.What run level represents multi-user? A. 3 B. 0 C. 1

D. 5 Answer: A 62.Which of the following switches can be used with the tar command to find out the diffe rence between two tar files? A. -c B. -v C. -d D. -t Answer: C 63.You want to add files to a previously created tar file. You want to re place existing files with ne wer files, how can you do this? A. Use the appe nd command B. Use the tar command with the -t switch C. Use the add command D. Use the tar command with the -u switc h Answer: D 64.You had a contractor come into your compa ny. You originally set his account to expire afte r thirty days. You now need to c hange this. How can you do this? A. use rmod -e B. usermod -a C. usermod -x D. usermod -d Answer: A 65.You want to add information to a prev iously created tar file. How would you do this? A. Use the tar command with the -a switch B. Use the appe nd command C. Use the add command D. Use the tar command with the -r switc h Answer: D 67.What option is used with the useradd command to specify the use r's use r id? A. -u B. -s C. -ui D. -id Answer: A 68.You are adding a ne w use r. You want to create the use r's home d irectory only if the directory does not exist. Which of the following would accomplish this? A. use radd -m B. useradd -h -y C. useradd -u D. useradd -h

Answer: A 69.Which of the following can be used to switc h your system to run level 1? A. init 1 B. inittab 1 C. rlevel 1 D. level 1 Answer: A 70.What run level represents administration mode? A. 0 B. 1 C. 6 D. 5 Answer: B 71.What file does init processes use as its control file? A. /etc/inittab B. /etc/proc C. /etc/init D. /etc/initproc Answer: A 72.Which of the following commands can be used to c reate a tar arc hive file in verbose mode? A. tar -v B. tar -cvf C. tar -c D. tar -vf Answer: B 73.What option is used with the useradd command to specify the use r's login shell? A. -s B. -l C. -u D. –sh Answer: A 74.Which of the following can be used to cha nge a use r's home directory? A. use rmod -d B. usermod -h C. usermod -u D. usermod -c Answer: A 75.Which of the following commands can be used to extract a tar file? A. tar -vf B. tar -xvf C. tar -e D. tar -v Answer: B 76.You want a user's account to expire in ten days. What option used with the

useradd command will allow you to do this? A. -e B. -u C. -d D. –t Answer: A 77.What command can be used to find the curre nt run level? A. runlevel B. level C. show level D. rlevel Answer: A 78.What switch is used with the usera dd command to specify a use r's initial group? A. -g B. -i C. -u D. –ig Answer: A 79.What run level represents a powe r down? A. 5 B. 0 C. 1 D. 4 Answer: B 80.What run level represents a system reboot? A. 6 B. 1 C. 2 D. 5 Answer: A 81.You want to find out what files are containe d in a ta r file. How would you do this? A. Use the tar command with the -t switch B. Use the tar command with the -r switc h C. Use the grep command D. Use the find command Answer: A 82.Whe n a use r executes the command "ps ax", what is shown on the console? Choose atl that apply. A. Process's use r-related information B. Processes without controlling terminals C. Processes used by the XF ree86 System D. All regular processes E. Processes on remote machines

Answer: B, D 83.What will the command "kill -HUP 1354" do? A. Kill the process 1354 destructively B. Kill the process 1354, allowing cleanup of memory C. Restart the process 1354, re-reading it's config files D. Restart the process 1354, resetting it's assoc iated modem Answer: C 84.You need to have all the output from the executable myprog written to a text log named file1.out. This program must not send any output to the console. Which of the commands listed will accomplish this? A. myprog > file 1.out 2>&1 B. myprog > file 1.out 1>&2 C. myprog > file1.out 1> /dev/null D. myprog 1&2> file1.out E. myprog 1> /dev/null > file1.out Answer: A 85.What are the de fault permissions for the Red Hat /etc/passwd file? A. 644 B. 640 C. 400 D. 641 E. 440 Answer: A 86.What are the de fault permissions on the Red Hat /etc/shadow file? A. 644 B. 600 C. 400 D. 444 E. 640 Answer: C 87.What are the de fault permissions on the Debian /etc/passwd file? A. 644 B. 640 C. 777 D. 700 E. 400 Answer: A 88.What are the de fault permissions on the Debian /etc/shadow file? A. 654 B. 640 C. 400 D. 644 E. 540 Answer: B

89.Which of the following directories would be the least like ly to need bac king up? Choose Two. A. /usr B. /etc C. /home D. /tmp E. /swap Answer: D, E 90.Which of the following will copy file1.txt to file 2.txt? Choose Two. A. cat file1.txt > file2.txt B. cat file1.txt | file2.txt C. cp file1.txt > file 2.txt D. c p file1.txt file 2.txt E. cpio < file1.txt > file2.txt Answer: A, D 91.Whe n you c reate a ne w file, the permissions show as 654. What value is the umask likely set at? A. 012 B. 002 C. 123 D. 022 Answer: A 92.Whe n you c reate a ne w directory, you see the permissions are set to 600. What umask value would cause this to happen? A. 177 B. 066 C. 244 D. 155 E. 333 Answer: A 93.You need to display all files in the curre nt directory that start with a "a " a nd end with a "v ", regardless of the ir length or use of de limite rs. Choose the best answer. A. ls a*v B. ls a.v C. ls a-v D. ls [a-v] Answer: A 94.What command with switches will display the disk utilization for all mounted file systems? A. df B. vmstat C. du D. top E. free

Answer: A 95.Which command will show the numbe r of free and used inodes for your system's mounted file systems? A. du -i B. df -i C. ls -iR / D. freeinodes Answer: B 96.Which of the commands will show you only the middle 10 lines of a 30 line text file named textfile? A. head -n 11-20 textfile B. head -n 20 textfile | tail C. tail -n 11-20 D. cat textfile | pr -n 11-20 E. nl -n 11-30 textfile Answer: B 97.Which command will display in reverse orde r a file that is numbered from 1 to End of File? A. cat file | nl | pr B. cat file | nl | tac C. cat file | tac | nl D. cat file | pr -n | reverse E. None of the above Answer: B 98.What command will show the first 10 lines of a file by defa ult? A. head B. cat C. tac D. nl E. tail Answer: A 99.What command will show the last 10 lines of a file by de fault? A. tail B. head C. cat D. prstat E. ps Answer: A 100.What is the result of the comma nd: # kill 9 13459 A. Kill PID 13459 with a signal 15 B. Kill PID 13459 with a signal 1 C. Kill PID 13459 with a signal 9 D. None of the above Answer: D

101.How can you execute two commands, the second one be ing executed only if the first returns a nonzero (program execution faile d) exit status? A. command1 || command2 B. command1 && command2 C. command1 $$ command2 D. command1 @@ command2 Answer: A 102.You want to move all files in /dir1 to /dir2 that begin with a and end with v. What is the correct command to do this? A. mv /dir1/a*v /dir2 B. mv -r /dir1/a.v /dir2 C. move /dir1/a?v /dir2 D. ls a*v | cp /dir2 E. mv /dir1/[a-v ] /dir2 Answer: A 103.What ste ps need to be performed, to make a ne w disk accessible to users? A. fdisk B. mkfs C. mount D. stat E. quotaon Answer: A, B, C 104.What switch will set the foreground color in X? A. fg B. foreground C. xfg D. fregrnd E. None of the above Answer: A 105.What two files are used to configure a user's env ironment that was created with the de fault options? A. ~/.profile, ~/.bashrc B. /etc/profile, /bashrc C. ~/.bash_profile, ~/.bashrc D. /etc/.login, ~/.login E. None of the above Answer: C 106.Whic h utility would be used to verify the c hecksum of a downloaded archive file? A. verify B. chksum C. md5sum D. c hkrpm E. pkgchk

Answer: C 107.With a Linux 2.2 Kernel-based machine configuration of 133 MHZ, 32 MB RAM and a 1 GB HD, how much swap should be configured? A. 512MB B. 256MB C. 128MB D. 64MB E. 32MB Answer: D 108.A directory contains the following files: #ls ratas saran jacaw cabal cabin You issue the command "ls | grep .a[^b]a.", what files are returned by the command? Choose all that apply. A. ratas B. jacaw C. saran D. cabal E. cabin Answer: A, B, C 109.Whic h of the following will allow both the commands to execute, regardless of their individual exit status? A. command1 | command2 B. command1 $ command2 C. command1 & command2 D. command1 ; command2 E. command1 ^ command2 Answer: D 110.Whic h of the following will cause command2 not to execute if command1 fails? A. command1 & command2 B. command1 && command2 C. command1 || command2 D. command1 | command2 E. command1 ; command2 Answer: B

characte r.

111.A user needs to search a file for lines that contain the asterisk Which grep search command will accomplish this? Choose all that apply. A. grep \* textfile B. gre p '*' textfile C. grep "*" textfile D. gre p \<*\> textfile

E. gre p "'*'" textfile Answer: A, B, C 112.According to the Filesystem He irarchy Standard, what directory trees a re conside red optional on a system's root filesystem? Choose all that apply. A. /mnt B. /root C. /usr D. /var E. /opt Answer: C, D, E 113.What command with options will show the c urrently mounted filesystems usage in kilobytes? A. df - k B. df -h C. du - k D. du -h E. du -s Answer: A 114.You need to alter the pe rmissions on the directory /home/mrking and all it's contents to matc h the following pe rmissions. drwxr--r-- Which of these commands with options and argume nts will accomplish this? Choose two. A. chmod 0744 /home/mrking - R B. chmod 744 /home/mrking/* C. chmod -R u=rwx,g=r,o=r /home/mrking D. c hmod u+rwx,g+r,o+r /home/mrking Answer: A, C 115.Whic h steps are necessary to compile and install a source code program? Choose the least amount possible. A. Extract source B. edit makefile C. ./configure D. make E. make install Answer: A, C, D, E 116.Whic h command cannot normally be executed by a non-root use r when compiling an application? A. make B. makefile C. ./configure D. make install Answer: D

117.Select all the ways of exiting and saving a vi session. A. :wq B. :w C. :ZZ D. Shift ZZ

E. F. :exit Answer: A, D, E 118.You want to examine the changelog for the installed pac kage “postfix”. Which command will display the changelog? A. rpm –Vc postfix B. rpm –qpil postfix C. rpm --changelog postfix D. rpm –q --change log postfix E. rpm –qa --change log postfix Answer: D 119.Afte r a minor sec urity incident you are instructed by your lead sys -admin to verify the RPM‟s insta lled on a running system. Which command will create a complete report which you can a nalyze for c hanges which may be security re lated? A. rpm –Va >report B. rpm –Qavy >report C. rpm –Vqt --nomd5 >re port D. rpm --checkfiles >report E. rpm –Va --nofiles >report Answer: A 120.You need to know whe re all the configuration files for the installed packa ge named “postfix” are located. Assuming it was installe d with rpm, which command will list this information for you? A. rpm –qc postfix B. rpm –Vc postfix C. prm --config postfix D. rpm –listconfig postfix E. prm –qa --config postfix Answer: A 121.Whic h of these commands would report how many total accounts (inc ludi ng special accounts) there are? A. count /etc/passwd B. nl /etc/passwd | head C. wc --users /etc/passwd D. wc --lines /etc/passwd

E. expand --lines /etc/passwd Answer: D 122.Whic h two programs will allow you to change the priority of a program already running? (Choose two) A. top B. nice C. niceit D. renice E. chnice Answer: B, D 123.Whic h command removes all subdirectories in /tmp, regardless of whethe r they are non-existent or in use? A. del /tmp/* B. m –rf /tmp C. rm –Ra /tmp/* D. rm –rf /tmp/* E. delete /tmp/*,* Answer: D 124.What utility would use to remove/display columns from each line of a file? A. pwd B. col C. cut D. tail E. extract Answer: C 125.If you set the umask to 022, by default what pe rmissions will your files have? A. 0220 B. 0557 C. 0644 D. 0755 Answer: C 126.Whic h of the following commands may be used to vie w PC I dev ices seen by the Linux ke rne l? (Choose two) A. less lspc i B. less /dev/pci C. less /proc/pci D. less /proc/devices/pc i E. lspc i | less Answer: C, E 127.You have the following file: -rwxrwxr-x 1 foo root 0 Feb 23 07:48 /bin/foo Which of the following commands will c hange the owne r of the file /bin/foo from the foo user to the

bar user without affecting group ownership? A. chown /bin/foo bar B. chown bar /bin/foo C. chown bar.foo /bin/foo D. c hown.foo.bar /bin/foo Answer: C 128.Your machine has two working NIC's with proper addresses. You want to split your network into two ne w subnets. What single command will accomplish this? A. ifconfig B. route C. default D. netstat E. None of the c hoices Answer: A 129.What command will set a regular users password to force changing it every 60 days? Choose all that apply. A. passwd -x 60 user1 B. chage -M 60 use r1 C. passwd +x 60 use r1 D. useradd -e 60 use r1 E. usermod -f 60 use r1 Answer: A, B 130.Where are the de fault settings for the use radd command ke pt? A. /etc/de fault/use radd B. /etc/sysconfig/useradd.cfg C. /etc/.useradd D. /etc/defaults/use radd E. /etc/login.defs Answer: A 131.How can you dete rmine who has sc heduled at jobs? A. at –l B. at –q C. at –d D. atwho Answer: A 132.You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by chec king the bac kup log but you do not know how the directory structure was stored. What command can you use to determine this? A. tar fx ta rfile dirname B. tar tvf tarfile file name C. tar ctf ta rfile D. tar tvf tarfile

Answer: D 133. You need to find out which pac kage owns a file ca lled /etc/paper.config. Which command will answe r this question? A. rpm -qf /etc/paper.config B. rpm – qa | grep /etc/pape r.config C. rpm -Fq /etc/pape r.config D. rpm -q /etc/paper.config E. rpm --requires /etc/pape r.config 134. Which of the following TC P/IP network utilities is the BEST tool to use to establish if a given IP address is reachable unde r the c urrent network configuration? A. ping B. finger C. route D. host 135.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. ** -i /dev/hda3 E. df -i /dev/hda3 136. You want to install the tarball fooba r.tar.bz2. What command would unpac k 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 fooba r.tar.bz 2 | ta r xf – 137.You have to move the whole directory-tree /home/foo to /oldusers. What command would you use? A. move /home/foo /olduse rs B. mv /home/foo /olduse rs C. mv -r /home/foo /oldusers D. mv - R /home/foo /olduse rs E. cp --move /home/foo /oldusers 138.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 139. How could you display any line of text from the file foo which starts with an upcase lette r? A. grep "^[A-Z]" foo B. grep "[A-Z]" foo C. grep "$[A-Z]" foo D. grep [A-Z] foo 140.You want to list the conte nts of the directory “directory1” with a ny errors going to the file “e rror1”. How would you do this? A. ls directory1 0>error1 B. ls directory1 2>e rror1 C. ls directory1 >e rror1 D. ls directory1 1>error1 141.What is the default priority that processes sta rt with? A. 1 B. 100 C. 0 D. 10 142.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 143. Which command c reates a soft link? A. link –s B. link –soft C. ln –soft D. ln –s 144. . You have a text file name d 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 145.Using vi, you want to save c hanges to the file myfile with :w!, but vi complains it cannot write to the file. There fore, you want to chec k the write pe rmissions on the

file. To do this without leaving vi, you type: A. :!ls -l myfile B. :\ls -l myfile C. esc :ls -l my file D. :?ls -l myfile Answer: A 146.While using the vi editor, you wish to move a head one page . You should press the control key and: A. A B. D C. F D. U Answer: C 147.Type in the VI command line that would open the file mytestfile.txt and line numbe r it? Answer: vi +"set numbe r" mytestfile.txt Answer: -vi mytestfile.txt +"set number" Answer: --vi "+set numbe r" mytestfile.txt Answer: --vi mytestfile.txt "+set number" 148.Select all the ways of exiting and saving a vi session. A. :wq B. :w C. :ZZ D. Shift ZZ

E. F. :exit Answer: A, D, E

characte r.

149.A user needs to search a file for lines that contain the asterisk Which grep search command will accomplish this? Choose all that apply. A. grep \* textfile B. gre p '*' textfile C. grep "*" textfile D. gre p \<*\> textfile E. gre p "'*'" textfile Answer: A, B, C 150.Whic h command would you use to change the priority of a running process? A. re nice B. nice C. kill D. pstree E. killall Answer: A 151.Whic h two programs will allow you to change the priority of a program already running? A. top

B. nice C. niceit D. renice E. chnice Answer: A, D 152.You wish to kill a process with a PID of 123. Se lect the comma nd, whic h will allow the process to "clean up" be fore exiting. A. kill -1123 B. kill -9123 C. kill -15123 D. kill -17123 Answer: C 153.What command changes the priority of the process running with process id of 12345 to the highest priority? A. /usr/bin/re nice +20 1234 B. /usr/bin/re nice -20 12345 C. /bin/setpriority +20 12345 D. /bin/setpriority -20 12345 Answer: B 154.What key se quence will suspend the curre nt process and return you to a she ll prompt? A. Ctrl-z B. Ctrl-c C. Ctrl-x D. Ctrl-d Answer: A 155.Whic h of the following commands is equiva lent to kill 1234? A. kill -1 1234 or kill -s SIGHUP 1234 B. kill -2 1234 or kill -s SIGINT 1234 C. kill -3 1234 or kill -s SIGQUIT 1234 D. kill -9 1234 or kill -s SIGKILL 1234 E. kill -15 1234 or kill -s SIGTERM 1234 Answer: E 156.What is the default process priority when a process is sta rted using the nice command? A. -10 B. 10 C. 20 D. 0 Ans wer: D 157.What option can be used with the shutdown command to send a warning message alerting users that the system will be shut down? A. shutdown - k B. shutdown - w C. shutdown -a D. shutdown -c

Answer: A 158.What will the command "kill -HUP 1354" do? Select all the apply A. The same as kill -9 1354 B. The same as kill 15 1354 C. The same as kill -15 1354 D. The same as kill -SIGHUP 1354 E. The same as kill -1 1354 Answer: D, E 160.What is the result of the comma nd: # kill 9 13459 A. Kill PID 13459 with a signal 15 B. Kill PID 13459 with a signal 1 C. Kill PID 13459 with a signal 9 D. None of the above Answer: D 161.In order to appe nd the output of ls to a file ca lled result, which of the following command lines would you use? A. ls > result B. ls >& result C. ls &> result D. ls >> result Answer: D 162.You need to c reate a simple hie rarc hy of irectories:images/photos/summe r/otta wa/. None of the directories on that path exists. What command will create a ll of the needed directories in one step? A. mkdir -r images/photos/summe r/ottawa/ B. mkdir - R images/photos/summer/ottawa/ C. mkdir -p images/photos/summe r/ottawa/ D. mkdir -P images/photos/summe r/otta wa/ E. mkdir -m images/photos/summer/ottawa/ Answer: C 163.What will the command cd ~ Certkiller do? A. Changes directory to the user Certkille r 's home directory B. Changes to a directory named Certkille r in the c urrent use r's home directory C. Changes to directory /etc/ Certkiller D. Produces a syntax e rror E. None of the above Answer: A 164.Whic h of the following commands will duplicate the contents of the /A directory in the existing and empty /B directory? A. mv /A/* /B B. mv /A/ /B C. mv /A /B D. mv /A/* . Answer: A 165.You want to move all files in /dir1 to /dir2 that begin with a and end with v.

What is the correct command to do this? A. mv /dir1/a*v /dir2 B. mv -r /dir1/a.v /dir2 C. move /dir1/a?v /dir2 D. ls a*v | cp /dir2 E. mv /dir1/[a-v ] /dir2 Answer: A 166.You need to display all files in the c urrent directory that sta rt with a "a" and end with a "v ", regardless of their length or use of de limite rs. Choose the best answe r. A. ls a*v B. ls a.v C. ls a-v D. ls [a-v] Answer: A 167.As root you have navigated to directory /B. You wish to move a ll of the files and directories from directory /A to directory /B. Which of the following options would be the most appropriate comma nd line to execute this task? A. cp /a/* . B. mv -f /A/* . C. mv -Rf /a/* . D. c p -f /a/* .. E. cp -rf /A/* /b/ Answer: B 168.Whic h line below would count the total numbe r of lines with the word " Certkiller " in /var/log/maillog? A. wc -l ' Certkiller /var/log/maillog' B. for " Certkiller " in [maillog (count) +1] C. wc -l /var/log/maillog | gre p ' Certkiller ' D. cat /var/log/maillog | grep ' Certkiller ' | wc -l E. cat /var/log/mailog | grep ' Ce rtkille r ' | wc -r Answer: D 169.What utility would use to remove/display columns from each line of a file? A. pwd B. col C. cut D. tail E. extract Answer: C 170.Whic h of the following will copy file 1.txt to file2.txt? Choose Two. A. cat file1.txt > file2.txt B. cat file1.txt | file2.txt C. cp file1.txt > file 2.txt D. c p file1.txt file 2.txt E. cpio < file1.txt > file2.txt Answer: A, D

171.What command will show the last 10 lines of a file by defa ult? A. tail B. head C. cat D. prstat E. ps Answer: A 172.What command will show the first 10 lines of a file by de fault? A. head B. cat C. tac D. nl E. tail Answer: A 173.Whic h command will display in reverse order a file that is numbere d from 1 to End of File? A. cat file | nl | pr B. cat file | nl | tac C. cat file | tac | nl D. cat file | pr -n | reverse E. None of the above Answer: B 174.Whic h of the commands will s how you only the middle 10 lines of a 30 line text file named textfile? A. head -n 11-20 textfile B. head -n 20 textfile | tail C. tail -n 11-20 D. cat textfile | pr -n 11-20 E. nl -n 11-30 textfile Answer: B 175.Whic h of the following would do the same as the command cat < file1.txt > file2.txt? A. cat < file1.txt file2.txt B. cat file1.txt >file2.txt C. cat file2.txt Answer: B 176.What command would help you identify the I/O address range be ing used by the network card? A. cat/proc/modules B. cat/proc/devices C. cat/proc/meminfo D. cat/io/dma E. cat /proc/ioports Answer: E

177.Whic h of the following would copy the file file 1.txt to tile 2.txt? A. cp file 1.txt | file2.txt B. cat file1.txt | file2.txt C. cat file 1.txt > file2.txt D. copy file1.txt | file2.txt E. cat | file 1.txt |file 2.txt Answer: C 178.Whic h of these commands would report how many total accounts (inc luding special accounts) there are? A. count /etc/passwd B. nl /etc/passwd | head C. wc --users /etc/passwd D. wc --lines /etc/passwd E. expand --lines /etc/passwd Answer: D 179.You logged in as user linux1, but now you want to switch use rs to linux2 with linux's env ironment. How would you do this? A. su linux2 B. su -e linux2 C. su - linux2 D. su -m linux2 E. su - f linux2 Answer: C 180.You are logged in as user tux1, but now you want to switc h users to tux2 with tux2's environment. How would you do this? A. su tux2 B. su -e tux2 C. su - tux2 D. su -m tux2 E. su - f tux2 Answer: C 181.You had a contractor c ome into your company. You originally set his account to expire afte r thirty days. You now need to change this. How can you do this? A. use rmod -e B. usermod -a C. usermod -x D. usermod -d Answer: A 182.What option is used with the use radd command to spec ify the user's login shell? A. -s B. -l C. -u D. -sh Answer: A 183.What option is used with the use radd command to spec ify the user's user id?

A. -u B. -s C. -ui D. -id Answer: A 184.What switch is use d with the use radd comma nd to spec ify a user's initial group? A. -g B. -i C. -u D. -ig Answer: A 185.You want a use r's account to expire in te n days. What option use d with the useradd command will allow you to do this? A. -e B. -u C. -d D. -t Answer: A 186.You are adding a ne w user. You want to create the user's home directory only if the directory does not exist. Which of the following would accomplish this? A. use radd -m B. useradd -h -y C. useradd -u D. useradd -h Answer: A 187.What switch is use d with the use rmod command to c hange a user's secondary groups? A. -G B. -group C. -d D. - U Answer: A 188.What option is used with the use radd command to spec ify the user's home directory? A. -d B. -h C. -u D. -a Answer: A 189.What command would execute cmd1 followed by cmd2, regardless of the exit status of cmd1? A. cmd1 cmd2 B. cmd1 | cmd2 C. cmd1 ; cmd2 D. cmd1 && cmd2

E. cmd1 || cmd2 Answer: C 190.You want to run three comma nds one afte r the other, but don't care what exit they had. What command line would do this? A. cmd1 cmd2 cmd3 B. cmd1, cmd2, cmd3 C. cmd1: cmd2: cmd3 D. cmd1; cmd2; cmd3 Answer: D 191.What symbol can be placed at the e nd of a line to indicate that the command continues on the next line? A. / B. \ C. ; D. | E. : Answer: B 192.Whic h command will print line numbe rs before each line in a file? A. ln B. nl C. cat -n D. numline Answer: C 193.In order to appe nd the output of ls to a file ca lled bazz, which of the following command lines would you use? A. ls > bazz B. ls >& bazz C. ls &> bazz D. ls >> bazz Answer: D 194.Whic h shell built-in command can be used to c reate a shortcut or pseudonym for a longer command? Assume a mode rn bourne -like shell, such as bash. A. shortcut B. ln C. sudo D. link E. alias Answer: E 195.In which file are you likely to find the settings for umask, path, and ulimit on a per user basis? A. /etc/profile B. /etc/bashrc C. ~/.bash_profile D. ~/.bashrc

Answer: C 196.Whic h of the following are executed ONLY during a Login session? Select all that apply. A. /etc/profile B. /etc/bashrc C. ~/.bashrc D. ~/.bash_profile E. ~/.bash_logout Answer: A, B, D 197.You installe d a beta rpm pac kage, but a re expe rienc ing some problems with it. How can you remove this pac kage ? A. rpm -qe rpmname B. rpm -V --remove rpmname C. rpm -r rpmname D. rpm -d rpmname E. rpm -ev rpmname Answer: E 198.You want to search the file myfile for all occ urrences of a string containing at least five c haracters, whe re c haracter numbe r 2 a nd 5 are "a" and c haracter numbe r 3 is NOT "b". Whic h command would you use? A. grep a*^b*a myfile B. gre p .a[^b].a myfile C. grep .[a].*.[a] myfile D. gre p .a*^b..a my file Answer: B 199.You have to test a ne w kernel ve rsion. Whic h of the following is the best way to add a ne w linux kernel in your system? A. rpm -fv h ke rnel_pac kage B. rpm -Uv h ke rne l_pac kage C. rpm -u ke rnel_pac kage D. rpm -u kerne l_package && make E. rpm --conflicts kernel_package Answer: B 200.You see following output while trying to install an updated pac kage: [root@example pub]# rpm -i gthumb-2.2.0.i386.rpm pac kage gthumb- 1.0.1.i386.rpm is already installed. Which command will allow you to install the updated version? A. rpm -i gthumb-2.2.0.i386. rpm B. rpm -ivh gthumb-2.2.0.i386.rpm C. rpm -U gthumb-2. 2.0.i3S6.rpm D. rpm -qu gthumb-2.2.0.i386. rpm E. rpm -qiv gthumb-2. 2.0.i386.rpm Answer: C 201.You want to previe w whe re the packa ge file, apache- xml.I386.rpm, will insta ll its files be fore installing it. What comma nd do you issue?

A. rpm -qp apache-xml.i386.rpm B. rpm -qv apac he-xml.i386. rpm C. rpm -ql apache-xml.i386.rpm D. rpm -qpl apache-xml.i386. rpm Answer: D 202.You have an updated RPM called screensaver-1.1.i386. rpm. You have version 1.0 installed. Using RPM, how do you vie w the c hange log of this file to see if you should install the update? A. rpm -qp --changelog sc reensaver-1.1.i386. rpm B. rpm --changelog screensaver-1.1.i386. rpm C. rpm -qc screensaver-1.1.i386. rpm D. rpm -showchange log screensaver-1.1.i386. rpm Answer: B 203.Whic h command will allow you to find a specific installed pac kage? A. rpm -- list rpmname B. rpm -qvl rpmname C. rpm rpmname D. rpm -qv rpmname E. rpm -f rpmname Answer: D 204.How can you update a pac kage only if an earlie r ve rsion is c urrently installed on the system? A. rmp -- update rpmname B. rpm -U rpmname C. rpm -F rpmname D. rpm -- force rpmname E. rpm -u rpmname Answer: C 205.Whic h command will c reate a complete re port which you can analyze for changes which may be sec urity related? A. rpm -Va >report B. rpm -Qavy >report C. rpm -Vqt --nomd5 >re port D. rpm --checkfiles >report E. rpm -Va --nofiles >report Answer: A 206.Whic h RPM command would produce the following output Name : xwhois Relocations: (not re locatable) Version : 0.3.7 Vendor: Certkille r

07 AM EDT

Re lease : 1 Build Data: F ri 06 Aug 1999 09 Install date: (not installed) Build Host: desktop.infohvy.com Group : Application/Inte rnet Source RPM: (none) Size : 74057 Lice nse: GPL Packager : Ryan Weaver URL : http://www.goatnet.ml.org/software.html

Summary : X Windows Whois Tool Description: xwhois is a small and fast que ry tool for the whois service. (rfc954) xwhois-0.3. 7.tar.gz xwhois.spec A. rpm -qpil xwhois-0.3. 7-1.src-rpm B. rpm-qx xwhois C. rpm-Vf xwhois-0.3. 7-1.src.rpm D. rpm-verify xwhois-0.3.7-1.src.rpm E. rpm-showheade rs xwhois-0.3.7-1.src.rpm Answer: A 207.You want to examine the changelog for the installed pac kage "postfix". Which command will display the changelog? A. rpm -Vc postfix B. rpm -qpil postfix C. rpm --changelog postfix D. rpm -q --change log postfix E. rpm -qa --change log postfix Answer: D 208.You need to know whe re all the configuration files for the installed package named "postfix" are located. Assuming it was installe d with rpm, which command will list this information for you? A. rpm -qc postfix B. rpm -Vc postfix C. prm --config postfix D. rpm -listconfig postfix E. prm -qa --config postfix Answer: A 209.Whic h of the following commands can be used to create a tar archive file in verbose mode? A. tar -v B. tar -cvf C. tar -c D. tar -vf Answer: B 210.Whic h of the following commands can be used to extract a ta r file? A. tar -vf B. tar -xvf C. tar -e D. tar -v Answer: B 211.You want to find out what files are contained in a tar file. How would you do this? A. Use the tar command with the -t switch

B. Use the tar command with the -r switc h C. Use the grep command D. Use the find command Answer: A 212.You want to add information to a previously c reated tar file. How would you do this? A. Use the tar command with the -a switch B. Use the appe nd command C. Use the add command D. Use the tar command with the -r switc h Answer: D 213.You want to add files to a previously c reated ta r file. You wa nt to replace existing files with ne we r files, how can you do this? A. Use the appe nd command B. Use the tar command with the -t switch C. Use the add command D. Use the tar command with the -u switc h Answer: D 214.Whic h of the following switc hes can be used with the tar command to find out the diffe rence between two tar files? A. -c B. -v C. -d D. -t Answer: C 215.You are installing a program that is only available as source code. Whic h of the following commands would be best to add system spec ific configuration information such as the de fault installation directory? A. ./make B. ./install C. ./make file D. ./configure Answer: D 216.The command for most applications to install compiled source via the Make file is: A. make B. install C. configure D. make depe nd E. make install Answer: E 217.Whic h command cannot normally be executed by a non-root use r when compiling an application? A. make B. makefile

C. ./configure D. make install Answer: D 218.What run level represents administration mode? A. 0 B. 1 C. 6 D. 5 Answer: B 219.What run level represents a power down? A. 5 B. 0 C. 1 D. 4 220.What run level represents a system reboot? A. 6 B. 1 C. 2 D. 5 Answer: A 221.Whic h of the following can be used to switch your system to run level 3? A. init 3 B. rlevel 3 C. level 3 D. inittab 3 Answer: A 222.What is corresponding device name on a Linux system? A. /dev/hda4 B. /dev/hda5 C. /dev/hdb4 D. /dev/hdb5 Answer: D 223.You are formatting a single hard disk for a Linux install. What is the maximum numbe r of primary partitions you can c reate? A. 0 B. 1 C. 2 D. 3 E. 4 F. 5 Answer: E 224.With a Linux 2.2 Kernel-based machine configuration of 133 MHZ, 32 MB RAM and a 1 GB HD, how much swap should be configured? A. 512MB B. 256MB C. 128MB

D. 64MB E. 32MB Answer: D 225.To build a fresh ne w Linux system, how much free space should you reserve for the Linux partition? A. 100 - 200MB B. 200 - 300MB C. 300 - 400MB D. 700 - 800MB Answer: D 226.Identify the prope r device for the third partition, on the second hard disk, on the first IDE controller on a PC system. A. /dev/hdb3 B. /dev/hd1b3 C. /dev/hdc1b3 D. /dev/hdc1d2p3 Answer: A 227.Whic h of the following device files would represent a USB disk? A. /dev/sda B. /dev/scsia C. /dev/hda D. /dev/sd0 E. /dev/scsi0 Answer: A 228.How many SC SI ids for pe ripherals ca n SCSI-1 support? A. 5 B. 6 C. 7 D. 8 Answer: C