CTS 1106 (Intro to Unix/Linux) Homework Assignment #4

 

Due: by the start of class on the date shown on the syllabus

Description:

The following questions all relate to Unix/Linux systems.  Answer as briefly (but completely) as possible, and assume I mean only POSIX or other utilities mentioned in class:

  1. Which are the characters that cannot be used in a filename?  (Note many characters should not be used, but only a couple are truly illegal.)  Can a space be used in a filename?
  2. Logically, directories contain other files and directories.  But with Unix/Linux, directories are just simple files with data in them.  What data does a directory file contain?
  3. What is a safer (as in less likely to cause damage to your system) alternative to “rm *”?  (That is, what option(s) can you use to make this safer?)
  4. How will you find out the total disk usage of the current directory tree (i.e., the size of the current directory and recursively all contents)?
  5. You have a complete directory structure (e.g., all files/directories in your home directory, recursively) to send to someone, possibly across the Internet.  (This means the file names and the file contents.)  Which command (that we have learned in class) is most suitable for the task, and how might you do it?
  6. A file contains 5,000 bytes on a filesystem that uses the standard blocksize of 4 KiB.  How many bytes of disk space would you expect this file to use?  (Hint:  It can't possibly be less than 5,000 bytes!)
  7. How do you list the attributes (i.e., the permissions, the owner, the size, etc.) of the current directory (and not the contents of the directory)?
  8. If some file doesn't have write permission for the owner, can the owner remove it?
  9. What should you do to make sure that no one can see the names of the files you have in your home directory?
  10. How can you determine whether two similar files are copies or hard links?
  11. What are the two main limitations of hard links?
  12. How does an administrator ensure that all files created by users in the future will have the default permissions rw-rw----?
  13. How will you count the number of files (including directories) in your home directory tree (that is, your home directory and recursively all sub-directories)?
  14. What command or pipeline will extract only the login names of the users from /etc/passwd, after ignoring the first 10 entries?

To be turned in:

Email your homework assignment, by copy-and-paste (no attachments please!) to .  If possible use the “text” and not the “HTML” mode of your email program.  Please use the subject similar to “Intro to Unix/Linux Homework Assignment #4 Submission”, so I can tell which emails are submitted homework assignments.

Homework assignments will not be returned.  Please do not send as attachments.  Do not send to wpollock@YborStudent.hccfl.edu.  Refer to the Homework and the Submitting Assignments sections of your syllabus for more information.

Confused?  Send questions about the homework assignment to .  Please use a subject similar to “Intro to Unix/Linux Homework Assignment #4 Questions” so I can tell which emails are questions about assignment quiz (and not submissions).