Q-1. One of your users has created a file called tmp (the command cat /etc/passwd > -tmp will do it). They want to delete it but can’t. Why might the user have difficulty removing this file? How would you remove it? You may have to refer to the online help section man pages to find the answer.
Q-2. What commands would you use to do the following:
a) View mkdir(2)
b) Find the command to print a file
c) Find out how many different manual pages exist for mkdir
d) Describe the contents of section 8 of the manual pages
Q-3. The following examples all work with the /etc/passwd file. /etc/passwd is the file that stores information about all the users of a UNIX machine. It is a text file with each line divided into seven fields. Each field is separated by a : character. Use the cat command to view the contents of the file.
a) sort /etc/passwd
sort in order based on the whole line
b) sort -r /etc/passwd
reverse the order of the sort
c) sort +2n -t: /etc/passwd
sort on third field,where field delimiter is: (skip the first two fields)
Q - 4. What command would you use to (assume you start from the original file for every question):
a) sort the file on the names
b) sort the file in descending order on phone number
c) display just the addresses
d) change all the! characters to:
e) display the first line from the file
f) display the line containing david’s information
g) What effect would the following command have paste-d: -sphone.book
Q-5. AUniversitystudentdatabasesystemmustproduceanumberoffilescontaininginformationaboutstudentsinaclass. One such example CSV file with 6 fields has the format: student number, surname, firstname, grade(F,P,C,D,HD), mark, degree code You may seek help from:
http://infocom.cqu.edu.au/85321/Reso.../6/results.csv Using previous descriptions in the lecture, this text book and the Linux manual pages, come up with commands toper form the following tasks on this example file:
a) count the number of students in the class (hint: there is one student per line in the file)
b) display the data file one line at a time
c) get alis to fall the student numbers in the class
d) Find all students who received HDs
Using the above matrices,find the matrices that represent