CS345 Operating Systems
Spring 2004
Laboratory Assignment 1

    The purpose of this assignment help you develop basic UNIX user skills. Skills such as logging in/out, accessing documentation, manipulating files and directories, and using a text editor. Pre-lab activity should include reading chapters 1 and 2 of  Unix for Programmers and Users. Feel free to have a second read of the chapters, in the lab, before a machine running Linux (or ssh to a machine running linux). As you read you can verify the examples in the text by entering the appropriate commands. You will use machine anita.simmons.edu  which can be accessed via ssh or putty. 

Do the lab individually, except for question 10.
 

0). Log in to your anita account and change your password. What command did you use? Logout and log back in to make sure that your new password works.


1) Verify that you can obtain information about the mkdir command via the man command.  Try to access a man page for a command that obviously doesn't exist (make up something crazy),  what happens if man cannot find the information you are requesting?


2). What is your default directory?


3). Draw a directory hierarchy showing the root directory, the level below root and the path down to your directory.





4). Create a file in your directory using the cat command. What is its default permission?


5). Make the subdirectory test1, in your directory. Move the file created in question 4 to this subdirectory. What commands did you use?



6). Delete subdirectory test1. What command(s) were required?



7). What are the file permissions on your directory?



8). What group(s) is your account in?



9). Create a file in your directory. Change the file permission so that only you have read permission and nothing else. Try to delete the file. What happens?



10). This part requires that you work with someone else in the class, pick a partner. Both of you need to be logged into your individual accounts. Each of you create a file. Try to access (read) each others file. What happens?  What do you have to do to allow your partner to read your file?



11). Play with the vi editor until you can easily create and edit a file to include: entering text, cursor movement, deleting text, replacing text, searching for text and saving the results. Create a file called text containing the paragraph "Editing a file : vi" found on page 54 of your text.


12). Once you have created, saved and displayed the file on the screen run the program that determines how many words are in the file. What commands did you use?


13). Access the man page for the ps command and determine how to get a list of all processes on the system. Redirect the output of the ps command to a disk file. Look at the man page for the sort command and figure out how to sort the list of processes by the program name the process is running. Send this sorted output to a disk file.  Now figure out how to use pipes to accomplish all of the above with one command with the result going to the display.