NAME - Download as PDF

Document Sample
NAME - Download as PDF Powered By Docstoc
					COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

1

NAME: . . . .......................................................................................

STUDENT NUMBER: . . . .............................................................

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

2

Unix Commands, 20 marks (1 mark each)

1) How do you get help about the command cp ?

2) How do you list all the files that are in the current directory?

3) How do you rename the file new to be the file old?

4) How do you visualize the content of file myfile without resorting to an editor?

6) How do you create a new directory called flower?

7) What is the command to search all files in your current directory for the word plasmodium?

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

3

8) How do you print the first 15 lines of all files with filename ending in .txt?

9) How do you copy the file upper.txt from the directory two levels up to your working directory?

10) How do you count all the files you own in all your directories?

11) How do you change your current directory to /usr/local/bin?

12) What access permissions should be set on the directory public html? Give the unix command for setting such permissions.

13) How do you create a new file new.txt that is a concatenation of file1.txt and file2.txt?

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

4

14) How do you remove a non-empty directory.?

15) How do you send the results of one command to another command?

16) How do you remove all carriage return characters from a DOS file?

17) What does ”pwd” in the command pwd stand for?

18) What command is used to change your password?

19) What is vi?

20) How do you get a list of all installed editors on your unix system?

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

5

Unix Concepts, 10 marks (5 marks each)

21) What is a unix shell? Write one paragraph explaining the shell concept.

22) What is sed? Write one paragraph outlining its design and use.

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

6

awk scripting, 10 marks (3 marks and 7 marks)

23) What does the following awk script do? awk ’$1 != prev { print; prev = $1 }’ file

24) You are presented with the text file attached to this question paper. The name of the file is COMP302.marks. Write an awk script (or scripts) that computes and prints out the student numbers of the top performing students. Also, explain how to execute your awk script (or scripts).

COMP302, Operating Systems, Test One, Tuesday the 10th of March, 2009

7

Contents of file COMP302.marks

UKZN, Pietermaritzburg, Computer Science COMP302, Operating Systems, 2009 StudentNo Surname FirstNames Test1 ============================================================= 205513861 Barath Sanjay Videsh 75 207526595 Gqozo Jongilizwe Nicholas 83 206511432 Khanyezi Christian Thandanani 43 207508424 Khumalo Bathobile Cleopatria 68 206516909 Khumalo Handsome Mvelo 54 205515596 Kumwenda Andreya Chimfwembe 72 207525369 Masimula Zanele Gloria 56 207525288 Mauluka Christine Rufaro 74 207511399 Mazibuko Sindiswa Zinhle 56 205523502 Mkhize Bongani Charles 78 207527415 Nabee Wajeeda 82 206512352 Ndaba Sihle Excellent 64 207500638 Ndlovu Mbuyiselo Mqondisi 77 207514664 Ngema Senzo Muziwamandla 49 207504087 Ntanzi Ntokozo Bernard 83 205511795 Ramiah Rooshen 65 207506711 Ramkilowan Arshath 75 207507892 Shange Simphiwe Cleopas 64 207508907 Walford Wesley Michael 77 206509805 Xaba Siyabonga 44 206509464 Zuma Edward Ndumiso 66 =============================================================


				
DOCUMENT INFO
Shared By:
Tags: NAME
Stats:
views:92
posted:12/15/2009
language:English
pages:7
Description: NAME