CIS 130 Exercises

Homework: Unix File Management

Complete the exercises below using the unix system and the bash shell. You may use your book and notes to help you. For each step, write the unix command used.

Part 1:

  1. Change to your home directory.
  2. Make a sub-directory "filemanhw" in your home directory.
  3. Make the new directory "filemanhw" your current directory.
  4. Display the path of your current directory.
  5. Copy all files whose filenames begin with the letter "P" (upper or lower case) from the directory /home/cis130
  6. Make a duplicate of the file "produce" and call this new file "thisis.fun"
  7. Make a duplicate of the file "thisis.fun". Call the new file "having.fun".
  8. Change the name of the file "thisis.fun" to "nomore.fun".
  9. List the contents of the directory "filemanhw" showing file sizes and permissions. Print the screen showing this information.
  10. List the contents of the directory "filemanhw" again and send it to a file called printme.
  11. Mail the file called printme to the acollard account. Use the subject "File Management"

Part 2: Complete the following tasks.

  1. In your home directory, create a directory named  "dogs".
  2. Change your working directory to the dogs directory.
  3. Use the cat command to create four files named snoopy, odie, fido, and pluto.
  4. Change the permissions on file snoopy to rwxrw----
    [read/write/execute for owner, read/write for group, nothing for others]
  5. Change the permissions on file odie to r-x-w---x
    [read/execute by owner, write-only for group, execute only for others]
  6. Change permissions on file pluto to r--r--r--
    [read-only for owner, read-only for group, read-only for others]
  7. List the contents of your "dogs" directory showing the file sizes and permissions and save it to a file called k9.
  8. Mail the k9 file to acollard, use the subject "Famous Canines."

 

This homework will be graded based on the printouts specified, the written list of commands used and successfully sending 2 mail messages to the acollard account.