Advanced Exercises


Advanced Exercises

11.

What is an inode? What happens to the inode when you move a file within a filesystem?

12.

What does the .. entry in a directory point to? What does this entry point to in the root (/) directory?

13.

How can you create a file named i? Which techniques do not work, and why do they not work? How can you remove the file named i?

14.

Suppose that the working directory contains a single file named andor. What error message do you get when you run the following command line?

$ mv andor and\/or

Under what circumstances is it possible to run the command without producing an error?

15.

The ls i command displays a filename preceded by the inode number of the file (page ). Write a command to output inode/filename pairs for the files in the working directory, sorted by inode number. (Hint: Use a pipe.)

16.

Do you think that the system administrator has access to a program that can decode user passwords? Why or why not? (See exercise 6.)

17.

Is it possible to distinguish a file from a hard link to a file? That is, given a filename, can you tell whether it was created using an ln command? Explain.

18.

Explain the error messages displayed in the following sequence of commands:

$ ls -l
total 1
drwxrwxr-x  2 alex pubs 1024 Mar  2 17:57 dirtmp
$ ls dirtmp
$ rmdir dirtmp
rmdir: dirtmp: Directory not empty
$ rm dirtmp/*
rm: No match.