Hello there slug members
It's me, David Herd again. I had a go with my assignment and had difficulties. Here is the assignment and some of my incomplete answers. Please help, this assignment is due tonight 12pm, show some mercy.

Write UNIX commands to

a) show the lines of the online manual page for sort that contain the word order.

b) show how many characters the date command outputs.

c) copy all C source files (the filenames end in .c) from the present working
  directory into a subdirectory called Cfiles.

d) list all files in the present working directory that have filenames
  that match:
                                starts with either t or T
                                the extension is a single digit

e) compress all the files in the directory Docs/ and store them in an
 archive called Docs.tar

f) sort the file /etc/passwd in reverse alphabetical order by username.

g) append all the lines of m1 that contain "name" to m2

h) Mail the present working directory contents to the current user
  with subject Directory.

Question 2. (4 marks)

m1, m2 and m3 are text files.
What do the follow commands do under bash?
Answer in English.

a) cat 1> m1

b) cat 0< m1 | sort 1> m2 2> m3

Question 3. (4 marks)

m1, m2 and m3 are text files.
What do the following commands do under tcsh?
Answer in English.

a) ls -l | grep admin |tee m1 | lpr -Pp1

b) zcat m.z | head -20

MY ANSWERS
1.
a. man sort
b. date
c. cp *.C /Cfiles
d. ls [t,T]
e.
f. sort
g. cat name> m2
h.

2.
a. sends all the lines containing 1 to file m1
b. do something with "cat 0<m1" and then pipe or send this onto "sort 1>m2 2> m3"

3.
a. give a long listing of all the files and pipe or send this result onto
b. another pipe command between these two commands


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to