Interclass Problem #1


For this interclass problem you will be doing some basic operations with the command-line to get comfortable with using it. 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.

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. We'll see how to do that at the end.

Once you have that, 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. You don't have to do the vi part from Wednesday, but if you want to read ahead so you can do it you should.

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, make sure that everything in the CS1 directory can be read by everyone. For this you can use the chmod command. Look at the man page for it. In this case you can execute "chmod -R a+rx CS1" if you are in the HTML-Documents directory. 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/~username/CS1/ where username is replaced by your username.