CSCI 1320 - Assignment #1


This assignment is intended to simply test your ability to use some of the functions that we have talked about in class to navigate around in Linux and alter files. During class we looked at the Local directory that you have under your home directory. One of the directories in it is called HTML-Documents. This is where you would place files if you wanted them to be visible to the outside world through the web server. I want you to do your work in here so that I can easily see if you did it. Once you have it done, you need to send me an e-mail with your username.

I want you to create a directory under Local/HTML-Documents called CS1 (use mkdir). Note that I do care about the capitalization here. Do a long format listing in the directory to see the permissions on that file. The permissions will probably look something like drwxr-xr-x (remember you can see permissions with ls -l). This means that you can read and write to it while anyone else can only read. If the last set of 3 characters doesn't have both r and x then you need to add those. For this you can use the chmod command. Look at the man page for it. In this case you can execute "chmod a+rx CS1" if you are in the HTML-Documents directory.

Once you have that and it can be read, I want you to copy the file /users/mlewis/persinfo.html into the CS1 directory (use cp). Then use vi to edit this file so that it has your information in it. I'd like you to put in your real name, but outside of that you can falsify information if you don't want it up on the web. You can be creative.

Now I want you to use the output redirection capabilities of Linux to create some new files. First, I want you to send the output of the command "ps -ef" to a file called allprocs.txt. After you have done this, I want you to do a long listing of the /users directory and pipe it to grep for the first two letters of your user name (for me that is ml). Direct the output of this grep to a file called nearname.txt. Lastly, run the command rusers and direct the output to users.txt (this might take a little while since rusers searches a number of machines). Now edit that file with vi. Do a search for mlewis and see how many times I'm logged onto machines in the department. Add a line at the top of the file stating "Dr. Lewis is logged into machines ?? times. What a resource hog!" where ?? has been replaced by the count that you found.

Lastly, make sure that everything in the CS1 directory can be read by everyone. To do this use the chmod command again and use a second argument of a+r and specify all files ("*"). Once this is done don't forget to send me an e-mail at mlewis@trinity.edu with your username in it. It might also be wise to point your web browser at that spot and make sure that everything looks fine. The URL will be http://www.cs.trinity.edu/~???/CS1/ where the ??? is replaced by your username.