TUESDAY

KEGENT UNIVERSITY COLLEGE OF SCIENCE AND TECHNOLOGY I

END OF SEMESTER EXAMZNATIONS, I LEVEL 300 OCTOBER 2008 I

COURSE: SYSTEMS PROGR~IMINGUSING UNIX & LINUX

SICS 3573

TIME: TWO AND HALF HOURS

LECTURER: BERNARD OTIMPONG PAPA K. ASAMOAU

Please Read ALL Instructions Carefully . . \ -. Section A used as a separator between cornrnancls when >.", Answer all Ouestions (1 Marks each) than one is typed in the shell prompt? .\

1. Linux refers to the first IDE hard disk as Idevihda and the first partition on the first hard disk as:

a. ldevicelal b ldevlhdl c. Idevlhl 6. Which of the following are benefits of symlinks (choose two)? d. Idevlhdal a. they automatically unzip files that have been compressed so that you can view them 2. When specifying a mount point (choose two). b. they allow you to use old command names to run current commands a. the directory cannot be the Idirectory c. they provide faster access to the shell prompt b. the directory can be the Idirectory or a subdirectory of the I, such d. they allow hesystem to operate as though there are two as lhome directories in two locations, but one just points to another and the c. the to the directory cannot be more than two directory levels files are actually only located in one of them deep d. the path to the directory can be more than two directory levels 7. Your current directory is lusrlshare/man. Select the two commands that deep, such as /homelcommon/shared-gr-data will you up one directory level.

3. If Windows is installed after Linux on the same system, the Windows a. lusrlman installation routine will usually wipe out the Linux boot loader in the MBR b. cd lusrlshare by replacing it with its own boot loader. This will prevent access to Linux c. cd .. because the Windows boot loader will only boot to Windows. T F d. cd ../share

Which of the commands below is run so that you can see the full path to 8. You have been reading some documentation at a web site about a utility the current directory? that you have installed named quicklook. The documentation for this program is in more than one manx directory. The documentation says a. cd 'see the quicklook man page for more information". b. dpath c. pwd Which command will you run so that you are sure that you will see the d. $HOME correct man page?

4. Your current directory is student, below /home and you are working as the a. man -f quicklook root user. A user named bbest has been created and a home directory b. manpage 3 quicklook was created for this user at that . Which of the following commands c. quicklook -k man will change you into the home directory of the bbest user? d. man -a

a. cd lhome ; lbbest 9. Using the man command with the -k option is the same as using the b. cd .. : cd bbest whereis command. T F c. cd lhomelbest d. cd ..lbbest - id ! a. !k idevlfbb 10. You have created a command (binary) nameb o,elloas well as a man page b, Idevlsdb for it. The command fits in category 1. c, fdisk Idevjhdb d. fdisk Idevlideb What should you use for the name and full path to the man page that describes the command? 16. Which command is used to create a mount point for a partition?

a. dmesg b. c. dt d. mkfs

17. Which option causes the cp, mv and rm commands to displays a message 11. You are editing the file named inittab with the vi editor. Select the that describes the actions of the command? command (series of keystrokes) that will search for :5: in the configuration file named inittab.

a. :/:5: b. 1:5: c. linittab :5: d. Is :5: 18. Which are the permission settings of the file named passwd in letc? 12. Which of the following are hidden bash configuration files (choose two)? a. rw-r--r--, root, root a. -1.bashgrofile b. w-r--w-, group, root b. Ietdbash C. war-rwx, mot, others c. -/.bash-history d. w-w-w-, root, root d. Ietdprofile-bash 19. Your XF86Config file contains the following section. What is the default 13. Select the file that should be used to add a directory path to the PATH for a screen resolution that will be used by the system? single user (only). Section 'Screen"

a. letdprofile i. Identifier 'Screeno" b. -/.bash-PATH ii. Device "AT1 Mach64 3D RAGE 11" C. a .sh file in letdprofile-d

iii.... Monitor.~~-~~~ "Monitor0 lv. DefaultDepth 16 v. Subsection 'Display" 14. Select the command that is run to test the settings in fstab afler it has 1. Depth 24 been edited to add a statement for a new partition. 2-. Modes.~-~~~ "1024x768" "800x600" "640x480"

vi.~~~ EndSubSection- a. mountest vii. Subsection 'Display" b. umount 1. Depth 16 c. mount 2 Modes "800x600" "640x480" d. fstab -I viii. ~ndiub~ection Endsection 15. You need to create a partition on the second IDE disk In a system. Select the command that you need to use to fdisk. a) 1024x768 Section C b) 640x480 c) 800x600 Answer ALL auestions. For each auestion ciearlv state the steps used in d) none of the above answerinp. Save vour work in a directow named with your INDEX No.

20. A system is currently running in "Gut mode". Which command will cause 1. How useful is the fstab file? Give the full pathname to this file. Create X to be stopped? your own of this file and edit it so it will mount ONLY futed drives.

1. init 3 a) State the command used to identify the current users working on 2. init 5 the system 3. xstart 3 With that command, manipulate the output to display ONLY all 4. runlevel 5 user names, the time they logged and save by directing this output to a file called 'users'.

Section B Answer all Questions (5 Marks each)

Write Short notes on any TWO ofthe following:

1. GNUILiiux 2. Open Development model 3. Open Source Software 4. Philosophy and the Use of Pipes in Unix

5. What is the Filesystem Hierarchy Standard (FHS)? How different are the following directories under this system:

a) Isbin b) mi c) /usribin d) lusrlsbin