CSCI 211: Unix Lab
Homework 4
(Due February 29, 2016,  23:59:59PM)

Note: 
1.	You must rely on UNIX commands only to solve the problems. No manipulation on Windows is allowed (such as scrolling the PuTTY screen). 
2.	A line of commands involving pipe ('|') or with ';' is not considered a single command.
Pre-step:
Run the command "source /lab4/quiz/prep.sh".
(If you run the pre-step again, you must redo all the problems.)
1.	Create an archive named "hw4_arc.tar" for all the files and directories under the "~/lab4" directory, then check the size of the archive.
Commands used:
The size (in bytes) of the archive:

2.	Compress the archive file " hw4_arc.tar" using gzip, then check the size of the compressed archive.
Commands used:
The size (in bytes) of the compressed archive:
 
3.	Uncompress the compressed archive obtained in the previous step.
Command used:

4.	Create a directory named "backup". Move the archive to that directory and extract the archive.
Commands used:

5.	Remove the whole directory of "backup", then in one single command, create an bzip'ed archive named "hw4_arc.tar.bz2" for all the files and directories under the the "~/lab4" directory, then check the size of the bzip'ed archive. Compare the size to that of the gzip'ed archive. Which has the better compression ratio for this case?
Commands used:
The size (in bytes) of the bzip'ed archive:
Which of bzip2 and gzip is better for this case?

6.	Create a directory named "backup2" and move the bzip'ed archive obtained in the previous step to it. After that, in one single command, extract the bzip'ed archive.
Commands used:

7.	Run a command to find out what day (in the week) the last day of 1899 is. Show the answer below. 
Command used:
The day of the last day of 1899:

8.	Run a command to show the current date in the format of "hh:mm:ss Month DD, YEAR", where hh is two digits of hour, mm is two digits of minute and ss is the tow digits of seconds. Month is the month name, DD is the two digits of day and YEAR is the four digits of the year. For example, the time shows as “16:31:47 March 18, 2013”.
Command used:

9.	Create an alias named 'date2' for the command used in the previous step. 
Command used:

10.	Save the alias in the previous step so that it is effective for every login afterwards. 
Command(s) used:

11.	What is the name of the two busiest processes? How many percent of CPU time is used for these two processes? Which user started them? 
Command(s) used:
Answer:

12.	How many processes are running under your username on the server at present? What are the command and id of the processes? 
Command(s) used:
Answer:

13.	Terminate the processes listed in the previous step except 'bash' and 'ps'.
Command(s) (used):

Post-steps:
1.	Run the command "source /lab4/quiz/wrapup.sh" exactly once. 
2.	Submit this file with your answers.
Save this file as yourlastname_yourfirstname_Lab4.rtf and then submit online at 
http://www.networks.howard.edu/lij/courses/2016/211/