Distributed Networks Distributed Networks

File Management  «Prev  Next»
Lesson 1

Introduction to File Management in Unix

Before beginning this course you should be comfortable with the following concepts.
  1. Using the ls command to list files
  2. Using wildcards (*, ?, and []) to create an efficient shorthand system for specifying file names
  3. How to copy, move, or remove files using cp, mv, or rm
  4. How to create or remove directories using mkdir and rmdir

This module will discuss advanced file management tasks. By the end of this module, you will be able to:
  1. List files recursively and list hidden files
  2. Copy a directory
  3. Remove a directory tree
  4. Create a link
  5. Find files on the system
In the next lesson, advanced ways to list files using the ls command will be discussed.

File Based Concepts

To gain a full picture of the internal operation of filesystems, it is necessary to understand what the user sees, why things are presented they way they are, and what the main concepts are. This module provides an introduction to basic file concepts. Users experienced in UNIX may wish to skip this chapter. Users new to UNIX and those starting to program in the UNIX environment will find these concepts useful. A basic implementation of the ls program helps to reinforce the material presented and provides an introduction to file-related libraries and system calls, a topic that will be expanded upon in the next chapter. One peculiarity that UNIX introduced was the notion that everything in the UNIX namespace (file tree) is visible as a file and that the same operations can be applied to all file types. Thus one can open and read a directory in the same way in which a file can be opened and read.
Of course, this does not always have the desired effect. For example, running the UNIX command cat on a directory will likely produce a screen full of unreadable characters. However, these and other simple concepts are one of the great strengths of UNIX. The following sections provide introductory material which describe file-based concepts and start to paint a picture of how these components fit together.