Main index

Introducing UNIX and Linux


Files

Overview
The UNIX directory hierarchy
Filesystems
Manipulating files
      Creating directories
      Creating files
      links
      'Dot' files
Protecting files
      Groups
      File access control
      Changing privileges
File contents
      Text files
      Comparing files
      Filtering files
      Non-text files
Printing files
File archives and file compression
Other relevant commands
Summary
Exercises

Exercises

  1. Write a script to list the three most recently altered files (including 'dot' files) in the current directory.

    View solution

  2. What type of file is /bin/id?

  3. List the files (excluding 'dot' files) in the current directory, together with their inodes, in numerical order of the inodes.

    View solution

  4. How many subdirectories are there in /usr?

  5. Write a script to display the owner of the current directory only.

    View solution

  6. Write a script to display the names of files in /bin and /usr/bin that have the same name.

  7. Write a script to list the files in the current directory (excluding 'dot' files) in 'long' format (that is, including the information that ls provides with option -l), and in increasing order of size (difficult).

    View solution

  8. List (without duplication) the groups that own the files in the current directory.


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck