Your global information security experts

Search for Vulnerabilities via
The National Vulnerability Database

*NIX related homework #1



1) Use the "du -a" command to generate a list of filenames and file sizes of the /usr/bin directory and redirect the output to a file called "myDU" in your own home directory.

2) Use the "sort" command with the appropriate option to sort the contents of "myDU" by FILENAME (not file size) and be sure to redirect the output to a new file, myDU2.

3) Copy the /etc/passwd file to your own directory. I want you to "more" the contents of this file and "cut" out the fields for username and userid and redirect that to a file in your home directory called "mypasswd". You'll need to look at the man pages for " cut" so that you can pull out the correct fields in the passwd file. (i.e. man cut)

4) "cd" into the /etc/skel directory. Now do an "ls -l", what did you see? Now do an "ls -la" , what did you get this time? Look at the files in that directory and consider the name of the directory ( skel). Tell me what you think each of this files might be.

5) "cd" back into the /etc directory and do a "more" on the motd file. Chances are that this file is empty. Now do a "man" on motd and see what you learn. "vi" the /etc/motd file and put in a personal message to yourself and then log out and log back in. Did you see your message?

6) Use the "last" command and redirect the output to a file called "mylast". Look at the mylast file. How many times have you logged in? Who else has logged in? The last line of the "last" output says something about wtmp. Do a "man" on wtmp and tell me what other file records some of the say information as wtmp. (hint: it's near the top of the man page)

7) Run the "dmesg" command and see what pops up. Can you give me a good idea of where this information came from and how useful it might be?