1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Kỹ thuật lập trình >

Chapter 9. Exam 101 Practice Test

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (10.57 MB, 1,207 trang )


This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks



9.1. Questions



1.



What two commands display the status of processes on a Linux system?

a.



ls and df



b. ps and top

c.



ps and df



d. df and top

e.

2.



du and df



What does the device file /dev/hdb6 represent?

a.



An extended partition on a SCSI disk drive



b. A logical partition on a SCSI disk drive

c.



An extended partition on an IDE disk drive



d. A primary partition on an IDE disk drive

e.

3.



A logical partition on an IDE disk drive



Which command will display the last lines of the text file file1?

a.



head -b file1



b. head --bottom file1

c.



head -v file1



d. tail file1

e.

4.



tail -n 1 file1



In the Bash shell, entering !! has the same effect as which one of the following?

a.



Ctrl-P and Enter



b. Ctrl-N and Enter

c.



Ctrl-U and Enter



d. !-2

e.

5.



!2



Which of the following commands can be used to check an ext2 filesystem? Select three that apply.

a.



fsck -ext2 /dev/hda5



b. fsck /dev/hda5



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

c.



e2fsck /dev/hda5



d. fsck.ext2 /dev/hda5

e.

6.



fsck.linux /dev/hda5



In response to the df command, the system reports aUse% of 98% for the filesystem mounted on/home. Which one of the

following best describes the significance of this information?

a.



Files on /home are consuming 98% of the physical disk.



b. File read/write activity on /home is consuming 98% of system I/O capacity.

c.



Files on /home are consuming 98% of the /home filesystem.



d. Inodes on /home are nearly exhausted.

e.

7.



Inodes on /home are 98% free.



Of the following directories, which one is the most important to back up on a routine basis?

a.



/var



b. /tmp

c.



/usr



d. /root

e.

8.



/etc



Carolyn has a text file named guest_list containing 12 lines. She executes the following command. What is the result?

# split -4 guest_list gl



a.



The first four columns in the text are written to new files glaa, glab, glac, and glad.



b. The first four columns in the text are written to new files aagl, abgl, acgl, and adgl.

c.



The lines of guest_list are evenly divided among new filesglaa, glab, glac, and glad.



d. The lines of guest_list are evenly divided among new filesglaa, glab, and glac.

e.

9.



The lines of guest_list are evenly divided among new filesaagl, abgl, and acgl.



Which one of the following commands would be best suited to mount a CD-ROM containing a Linux distribution, without

depending on any configuration files?

a.



mount /dev/cdrom /dev/hdc



b. mount -f linux /dev/hdc /mnt/cdrom

c.



mount -t iso9660 /dev/cdrom /mnt/cdrom



d. mount -t linux /dev/cdrom /mnt/cdrom

e.



mount -t iso9660 /mnt/cdrom /dev/cdrom



10. An ext2 filesystem is configured with user quotas enabled. The soft limit is set at 100 MB per user, the hard limit is set at 110

MB per user, and the grace period is seven days. User bsmith already owns 90 MB of the data stored on the filesystem.

What happens when bsmith writes a new file of size 30 MB? Select one.

a.



The write will fail, but the superuser can recover the entire file within seven days.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

b. The write will fail, and the file will be truncated permanently.

c.



The write will succeed, but the file will be truncated permanently.



d. The write will succeed, but the file will be available for only seven days.

e.



The write will succeed, but the file will be truncated in seven days.



11. Which of the following commands displays the comments from a bash script? Select all that apply.

a.



find "^#" /etc/rc.d/rc.local



b. sed '/^#/ !d' /etc/rc.d/init.d/httpd

c.



grep ^# /etc/rc.d/init.d/httpd



d. grep ^# /etc/passwd

e.



locate "^#" /etc/skel/.bashrc



12. State the syntax to direct the standard output of cmd1 directly into the standard input ofcmd2.

13. Which one of the following answers creates an environment variable VAR1, present in the environment of a bash child

process?

a.



VAR1="fail" ; export VAR1



b. VAR1="fail" \ export VAR1

c.



VAR1="fail"



d. set VAR1="fail" ; enable VAR1

e.



export VAR1 \ VAR1="fail"



14. Which of the following directories must be part of the root filesystem? Select two of the following that apply.

a.



/etc



b. /home

c.



/lib



d. /usr

e.



/root



15. Alex is currently working in a directory containing only one file, Afile1. What is displayed after the following commands are

entered in bash?

# MYVAR=ls

# echo $MYVAR "$MYVAR" '$MYVAR' '$MYVAR'



a.



Afile1 Afile1 Afile1 Afile1



b. ls Afile1 Afile1 Afile1

c.



ls ls Afile1 Afile1



d. ls ls $MYVAR Afile1

e.



ls ls ls $MYVAR



16. What does the & character do when placed at the end of a command?



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

a.



It allows another command to be entered on the same line.



b. It causes the process to be stopped.

c.



It restarts a stopped process.



d. It causes the process to be placed into the foreground.

e.



It causes the process to be placed into the background.



17. Which one of the following commands could be used to change all uppercase characters to lowercase in the middle of a

pipe?

a.



grep



b. egrep

c.



wc



d. tr

e.



pr



18. What is the PID of init? Select one.

a.



0



b. 1

c.



2



d. undefined

e.



unknown



19. Which one of the following outcomes results from the following command?

# chmod g+s /home/software



a.



The SUID bit will be set for /home/software.



b. The SGID bit will be set for /home/software, preventing access by those not a member of thesoftware group.

c.



The SGID bit will be set for /home/software, in order to keep group membership of the directory consistent for all

files created.



d. The sticky bit will be set for /home/software.

e.



The sticky bit will be applied to all files in /home/software.



20. Which one of the following commands is equivalent to the following command for user jdoe whose home directory is

/home/jdoe?

# chmod 754 ~/file1



a.



chmod u=rwx,g=rx,o=r /home/jdoe/file1



b. chmod ugo=rwx ~/file1

c.



chmod u=7,g=5,o=4 ~/file1



d. chmod 754 \home\jdoe\file1



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

e.



chmod 754 /usr/jdoe/file1



21. What command and single required option creates a symbolic link in a Linux filesystem?

22. What command can display the contents of a binary file in a readable hexadecimal form? Select one.

a.



xd



b. hd

c.



od



d. Xd

e.



dump



23. Which one of the following commands copies files with the .txt extension from /dir1 into /dir2, while preserving file attributes

such as dates?

a.



mv --copy /dir1/*.txt /dir2



b. mv /dir1/*.txt /dir2

c.



cp -k /dir1/*.txt /dir2



d. cp -p /dir1/*.txt /dir2

e.



cp -p /dir2 < /dir1/*.txt



24. Which one of the following file globs matches "Linux" and "linux," but not "linux.com" and not "TurboLinux"?

a.



[L/linux]



b. ?inux

c.



\L\linux



d. [Ll]inux

e.



[Ll]inux?



25. A process with PID 4077 is misbehaving on your system. As superuser, you enter the following command:

# kill 4077



However, nothing changes as a result. What can you do to terminate the process? Select one.

a.



kill -9 4077



b. kill -1 4077

c.



kill +9 4077



d. kill 4078

e.



kill --die 4077



26. Which one of the following key sequences is used to put a noninteractive text-mode program that is attached to the terminal

into the background to allow it to continue processing?

a.



Ctrl-C



b. Ctrl-B

c.



Ctrl-B and then enter the bg command



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

d. Ctrl-Z

e.



Ctrl-Z and then enter the bg command



27. What basic command is used to create hard disk partitions?

28. With a umask of 027, how is the initial mode set for a newly created file?

a.



0750



b. 0640

c.



0027



d. 1027

e.



1640



29. Which one of the following commands verbosely extracts files from a tar archive on a magnetic tape device?

a.



tar cvf /dev/st0



b. tar cvf /dev/ttyS0

c.



tar xvf /dev/st0



d. tar xvf /dev/ttyS0

e.



tar rvf /dev/st0



30. Alex wants to protect himself from inadvertently overwriting files when copying them with cp. How should he go about this?

a.



Put alias cp='cp -i' in ~/.bashrc.



b. Put alias cp='cp -i' in ~/.bash_profile.

c.



Put alias cp='cp -p' in ~/.bashrc.



d. Put alias cp='cp -p' in ~/.bash_profile.

e.



Put alias cp='cp -I' in ~/.bashrc.



31. Which one of the following utilities outputs a text file with line numbers along the left margin?

a.



tar



b. wc

c.



tr



d. nl

e.



ln



32. The following line comes from /etc/fstab Which of the statements is accurate given the contents of this line? Choosetwo that

apply.

/dev/fd0 /mnt/fd0 vfat noauto,users 0 0



a.



Users are prohibited from mounting and unmounting the filesystem.



b. Users are permitted to mount and unmount the filesystem.

c.



The filesystem will be mounted on mount point /dev/fd0.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

d. The filesystem is expected to be a Linux native filesystem.

e.



The filesystem is on a floppy disk.



33. Which one of the following is an accurate statement regarding this regular expression?

[^1-8A-Za-z]



a.



It matches all letters and numbers.



b. It matches all letters and numbers except 9.

c.



It matches all letters and numbers except 9 and 0, but only at the beginning of a line.



d. It matches 9, 0, and other nonletter and nonnumber characters.

e.



It matches characters other than letters or numbers.



34. Monica consults the /etc/passwd file expecting to find encrypted passwords for all of the users on her system. She sees the

following:

jdoe:x:500:500::/home/jdoe:/bin/bash

bsmith:x:501:501::/home/bsmith:/bin/tcsh



Which of the following is true? Select one.

a.



Accounts jdoe and bsmith have no passwords.



b. Accounts jdoe and bsmith are disabled.

c.



The passwords are in /etc/passwd-



d. The passwords are in /etc/shadow

e.



The passwords are in /etc/shadow-



35. What command (include applicable options) is used to initiate a change to runlevel 5?

36. What does the "sticky bit" do? Select one.

a.



It prevents files from being deleted by anyone.



b. It marks files for deletion.

c.



It prevents files from being deleted by nonowners except root.



d. It prevents files from being deleted by nonowners including root.

e.



It marks files for archive.



37. Dave has a Linux system with an interrupt conflict caused by his 3c509 network card. Dave's kernel is fully modular. How

could Dave instruct the system to use IRQ 11 for his network adapter?

a.



Enter linux eth0=irq11 at the LILO boot loader prompt.



b. Enter linux 3c509=irq11 at the LILO boot loader prompt.

c.



Add options 3c509 irq=11 to /etc/conf.modules.



d. Add options irq=11 3c509 to /etc/conf.modules.

e.



Add ifup -irq 11 eth0 to /etc/rc.d/rc.sysinit.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

38. What is contained in directory /sbin? Select the single best answer.

a.



Commands needed in the event of a system emergency of interest to all system users.



b. Commands of interest to all system users.

c.



Commands needed in the event of a system emergency of interest mainly to the administrator.



d. Commands of interest mainly to the administrator.

e.



Libraries needed in the event of an emergency.



39. What ext2 filesystem attribute allows a process to take on the ownership of the executable file's owner?

40. What is appended to the beginning of a command line in order to modify the execution priority of the resulting process?

41. How are the cat and tac commands related? Select one.

a.



cat displays files and tac does the same but in reverse order.



b. cat concatenates files while tac splits a file into pieces.

c.



cat creates file catalogs while tac displays the catalogs.



d. The two commands are links to the same executable.

e.



There is no relation or similarity between cat and tac.



42. With regard to the use of regular expressions to match text in a file, describe a metacharacter. Select one.

a.



They are standard text characters used in the regular expression.



b. They are special control characters used in the regular expression.

c.



They are used to display results after using a regular expression.



d. They are used by the shell to display graphics.

e.



Metacharacters aren't used in regular expressions.



43. How many IDE devices can be installed and simultaneously used in a typical Intel-based system? Select one.

a.



1



b. 2

c.



3



d. 4

e.



5



44. Which one of the following would be a consequence of a filesystem running out of inodes?

a.



More inodes would be automatically created in the filesystem.



b. Quotas would become disabled on the filesystem.

c.



The filesystem would be corrupted.



d. The filesystem would be marked read-only.

e.



No writes would be possible on the filesystem until existing files were deleted.



45. Consider the following line of console output, excerpted from among other lines of output. Which one of the commands

produced it?



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

/dev/hda8



a.



1.9G 559M 1.2G 30% /home



du -s



b. du -k

c.



df -h



d. df -k

e.



df -m



46. Which one of the following is true about the LILO boot loader?

a.



It can start the Windows NT Loader.



b. It is started using the lilo command.

c.



It is the only boot loader available for Linux.



d. It can start multiple Linux kernels, but no foreign operating systems.

e.



It resides entirely in the boot sector.



47. Which one of the following statements correctly describes the > and >> symbols in the context of the bash shell?

a.



> appends standard output to an existing file, and>> writes standard output to a new file.



b. > writes standard output to a new file, and>> appends standard output to an existing file.

c.



> writes standard error to a new file, and>> appends standard error to an existing file.



d. > pipes standard output to a new file, and>> pipes standard output to an existing file.

e.



> pipes standard output to an existing file and>> pipes standard error to a new file.



48. What is the correct syntax to remove mypkg entirely from a Debian GNU/Linux system, including configuration files? Select

one.

a.



dpkg -r mypkg



b. dpkg --remove mypkg

c.



dpkg --kill mypkg



d. dpkg -R mypkg

e.



dpkg --purge mypkg



49. Your system's FontPath directives include only one entry:

unix/:-1



Which of the following is true? Select one.

a.



Error -1 has occurred during X startup



b. Only the default font will be available to applications

c.



An X font server is to be used



d. An X font server failed to initialize



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

e.



No fonts were found by XFree86 or by a font server



50. How do you use dpkg to verify the status of an installed packagemypkg? Select one.

a.



dpkg -s mypkg



b. dpkg -S mypkg

c.



dpkg -stat mypkg



d. dpkg --stat mypkg

e.



dpkg --Status mypkg



51. Which of the following statements is true about an X server? Select one.

a.



An X server is a high-performance system offering graphical programs over a network.



b. An X server sends its graphical output to a window manager.

c.



An X server is under the control of a window manager.



d. A window manager is under the control of an X server.

e.



A window manager is also known as an X server.



52. What are the two interrupts usually associated with a PC's onboard serial interface?

53. How can you query the RPM database for a list of all installed RPM packages? Select one.

a.



rpm -q



b. rpm -qa

c.



rpm -a



d. rpm -al

e.



rpm -qal



54. Which pair of dpkg options are equivalent and what do they do? Select one.

a.



-C and --configure; they reconfigure an unpackaged package.



b. -C and --clear-avail; they erase existing information about what packages are available.

c.



-A and --audit; they update information about what packages are available.



d. -C and --audit; they provide resource consumption information on installed packages.

e.



-C and --audit; they search for partially installed packages.



55. What will happen when rpm is launched as follows?

rpm -Uvh file



a.



The RPM file will be verified.



b. An installed package may be upgraded with the version in file, with verbose output.

c.



An installed package may be upgraded with the version in file, with verbose output and hash marks indicating

progress.



d. An error will occur because a major mode is not specified.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

.

it. Thanks

e.



An error will occur because no file options were specified.



56. How are changes to the system BIOS made? Select one.

a.



Using linuxconf.



b. By manually editing text files.

c.



Using the lilo command.



d. At boot time using system-specific menus.

e.



At boot time using LILO commands.



57. When using xdm, which of the following files can be used to start a window manager? Select one.

a.



Xservers



b. Xaccess

c.



xdm-config



d. Xsession

e.



Xsetup_0



58. When partitioning a disk with more than 1024 cylinders, which of the following could affect the system's ability to boot? Select

all that apply.

a.



Location of LILO on disk.



b. Location of /boot on disk.

c.



Location of /var on disk.



d. Disk transfer rate.

e.



Disk seek time.



59. Which of the following is a reasonable size for a swap partition for a Linux workstation with 128 MB RAM? Select one.

a.



1 KB



b. 0.5 MB

c.



100 MB



d. 5 GB

e.



10 GB



60. What is XDMCP, and how is it used? Select one.

a.



An X utility, used to copy files between a host and an X terminal.



b. An X utility, used to configure XDM.

c.



An X utility, used to configure IP addresses on X terminals on the network.



d. An X protocol, used to discover/listen for X terminals on the network.

e.



An X protocol, used to exchange graphics information between X clients and X servers over the network.



61. How many target devices can be added to an 8-bit SCSI-2 bus? Select one.

a.



6



Xem Thêm
Tải bản đầy đủ (.pdf) (1,207 trang)

×