Introducing UNIX and Linux |
FilesOverview |
Creating filesThe first thing that must happen to a file before anything else
is that it must come into existence. This may happen by design of
another command (when you create it with an editor, for instance)
or as a side-effect. You will frequently find that the current
directory contains files you don't remember anything about! When
the data held in a file is no longer required, you may wish to
delete the file. Just as for file creation, this may be explicit or
implicit (some automatically created files may disappear
spontaneously). Suppose you have created a file called
When the command Sometimes it is useful to give a file several different names. This can often happen if you have data that needs to be accessed in several different directories, and any changes to it need to be made consistently. If you created several copies of the file, you would have to perform updates several times, once on each copy. This is inefficient, and errors might creep in. Also, storage space would be wasted - and if the files concerned are large data files this might well be an important consideration. We can use the concept of an inode to good effect here. Since a directory associates names with their storage locations via inodes, there is no reason why a particular file should not have several names, perhaps in different directories. |
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck