UNIX Unbounded 5 Edition: Amir Afzal
UNIX Unbounded 5 Edition: Amir Afzal
Amir Afzal
Chapter 5
Introduction to the
UNIX File System
Amir Afzal
UNIX Unbounded, 5th Edition 1 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Chapter 5: Introduction to the UNIX File System
This is the first of two chapters that discuss the file structure of the
UNIX system; Chapter 8 is the second.
Chapter 5 describes the basic concepts of files and directories and their
arrangement in a hierarchical tree structure. It defines the terminology
used in the UNIX file system. It discusses commands that facilitate the
manipulation of the file system, explains the naming conventions
for files and directories, and shows a practical view of the file system
and its associated commands in the terminal session exercises.
Amir Afzal
UNIX Unbounded, 5th Edition 2 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.1 DISK ORGANIZATION
• UNIX allows you to divide your hard disk into many units (called directories),
and subunits (called subdirectories), thereby nesting directories within
directories.
• UNIX provides commands to create, organize, and keep track of directories
and files on the disk.
Amir Afzal
UNIX Unbounded, 5th Edition 3 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3 ALL ABOUT DIRECTORIES
• The directory system provides the structure for organizing files on a disk
• The highest level directory is called the root and all other directories
branch directly or indirectly from it
Amir Afzal
UNIX Unbounded, 5th Edition 4 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-1 Directory Structure
Amir Afzal
UNIX Unbounded, 5th Edition 5 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
The terms parent and child describe the relationship between levels of the hierarchy.
Figure 5.2 shows this relationship. Only the root directory has no parents. It is the
ancestor of all the other directories.
Amir Afzal
UNIX Unbounded, 5th Edition 6 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3.1 Important Directories
Following are summaries of some of the more important directories on your UNIX System:
/
This is the root directory. It is the highest-level directory and all other directories
branch from it
/usr
This directory holds users’ home directories. In other UNIX systems including
Linux, this can be the /home directory
/usr/docs
This directory holds various documents
/usr/man
This directory holds man (online manual) pages
/usr/games
This directory holds game programs
/usr/bin
This directory holds user-oriented UNIX programs
Amir Afzal
UNIX Unbounded, 5th Edition 7 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
/usr/spool
This directory has several subdirectories such as mail, which holds mail files,
and spool, which holds files to be printed
/usr/sbin
This directory holds system administration files
/bin
This directory holds many of the basic UNIX program files
/dev
This directory holds device files. These are special files that represent the physical
computer components such as printer or disk
/sbin
This directory holds system files that usually are run automatically by the UNIX
system.
/etc
This directory and its subdirectories hold many of the UNIX configuration files
Amir Afzal
UNIX Unbounded, 5th Edition 8 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3.2 The Home Directory
• The system administrator creates all user accounts on the system and
associates each user account with a particular directory
• From your home directory you can expand your directory structure according
to your needs
• You can add as many subdirectories as you like and dividing subdirectories
into additional subdirectories
Amir Afzal
UNIX Unbounded, 5th Edition 9 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3.3 The Working Directory
While you are working on the UNIX system, you are always associated with a
directory. The directory you are associated with or working in is called the working
directory
Figure 5.3 shows that the directory called usr has three subdirectories called david,
daniel, and gabriel. The directory david contains three files, but the other directories
are empty.
2. Your login name and your home directory name are usually the same
and are assigned by the system administrator
4. The name of the root directory is always the forward slash (/)
Amir Afzal
UNIX Unbounded, 5th Edition 10 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5.3 shows that the directory called usr has three subdirectories called david, daniel,
and gabriel. The directory david contains three files, but the other directories are empty.
Amir Afzal
UNIX Unbounded, 5th Edition 11 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3.4 Understanding Paths and Pathnames
• Every file has a pathname. The pathname locates the file in the file system
• You determine a file’s pathname by tracing a path from the root directory to the
file, going through all intermediate directories
1. The forward slash (/) at the very beginning of a pathname stands for the
root directory
2. The other slashes serve to separate the names of the other directories
and files
Figure 5.4 shows a hierarchy and the pathnames of its directories and files.
For example, using Figure 5.4, if your current directory is root, then the path to a
file (say, myfirst) under the david directory is /usr/david/myfirst.
Amir Afzal
UNIX Unbounded, 5th Edition 12 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5.4 shows a hierarchy and the pathnames of its directories and files.
For example, if your current directory is root, then the path to a file (say, myfirst) under
the david directory is /usr/david/myfirst.
Amir Afzal
UNIX Unbounded, 5th Edition 13 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Absolute Pathname
• An absolute pathname (full pathname) traces a path from the root
to the file.
• An absolute pathname always begins with the name of the root directory,
forward slash (/). For example, if your working directory is usr, the absolute
pathname of the file called myfirst under the directory david is /usr/david/myfirst.
1. The absolute pathname specifies exactly where to find a file. Thus, it can
be used to specify file location in the working directory or any other
directory.
2. Absolute pathnames always start from the root directory and therefore
have a forward slash (/) at the beginning of the pathname.
Amir Afzal
UNIX Unbounded, 5th Edition 14 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Relative Pathname
• A relative pathname is a shorter form of the pathname. It traces a path
from the working directory to a file
• Like the absolute pathname, the relative pathname can describe a path
through many directories.
For example, if your working directory is usr, the relative pathname to
the file called REPORT under the david directory is david/REPORT
Amir Afzal
UNIX Unbounded, 5th Edition 15 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.3.5 Using File and Directory Names
• Every ordinary and directory file has a filename.
• UNIX gives you much freedom in naming your files and directories.
The use of more than one period in a file extension is allowed in UNIX.
Amir Afzal
UNIX Unbounded, 5th Edition 17 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4 DIRECTORY COMMANDS
Figure 5.5 is your directory structure, and your home directory is david.
Amir Afzal
UNIX Unbounded, 5th Edition 18 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4 DIRECTORY COMMANDS
In the following examples, assume that your login name is david, Figure 5.5 is
your directory structure, and your home directory is david.
/usr/david
$_ . . . . . . . . . . . . . . . . .Prompt for next command.
Amir Afzal
UNIX Unbounded, 5th Edition 19 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
1. /usr/david is your home directory pathname.
Amir Afzal
UNIX Unbounded, 5th Edition 20 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4.2 Changing Your Working Directory: The cd Command
To change your working directory to the source directory, use the following
command sequence:
$ pwd [Return] . . . . . . . . . . Check your current directory.
/usr/david
Amir Afzal
UNIX Unbounded, 5th Edition 21 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Assuming you have permission, you can change your working directory to /dev
by using the following command sequence:
Amir Afzal
UNIX Unbounded, 5th Edition 22 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4.3 Creating Directories
The very first time you log on to the UNIX system, you begin work from your home
directory, which is also your working directory.
• Displaying a shorter list of your files on the screen enables you to find a
file more quickly.
• You can use identical filenames for files that are stored in different
directories.
• You can take advantage of the UNIX commands that manipulate directories.
Amir Afzal
UNIX Unbounded, 5th Edition 23 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Directory Structure
Let’s start with the directory structure presented in Figure 5.6. Depending on your system
configuration and administration requirements, you might have other files or subdirectories in
your HOME directory.
Figure 5-6 Your Directory Structure at the Beginning
Amir Afzal
UNIX Unbounded, 5th Edition 24 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4.4 Directory Creation: The mkdir Command
The mkdir (make directory) command creates a new subdirectory under your working
directory or any other directory you specify as part of the command.
Amir Afzal
UNIX Unbounded, 5th Edition 25 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-7 Your Directory Structure After Adding the memos Subdirectories
Before
After
Amir Afzal
UNIX Unbounded, 5th Edition 26 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
While you are in your HOME directory, create a new subdirectory called important in
the memos directory.
$ cd [Return] . . . . . . . . . . . .
. . . Make sure you are in your HOME directory.
$ mkdir memos/important [Return] . . . Specify the important directory
pathname.
$ cd memos/important [Return] . . . .Change to important directory.
$ pwd [Return] . . . . . . . . . . . . . . . .Check your working directory.
/usr/david/memos/important
$_ . . . . . . . . . . . . . . . . . . . . . . . . . Now your working directory is important.
Figure 5.8 shows your directory structure after adding memos and important
subdirectories.
Amir Afzal
UNIX Unbounded, 5th Edition 27 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-8 Your Directory Structure After Adding the memos and important Subdirectories
Amir Afzal
UNIX Unbounded, 5th Edition 28 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5.9 shows how to create a directory called source under your HOME directory.
Figure 5.10 shows your directory structure after adding the source subdirectory.
Amir Afzal
UNIX Unbounded, 5th Edition 29 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-10 Your Directory Structure After Adding the source Directory
Before
After
Amir Afzal
UNIX Unbounded, 5th Edition 30 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
The mkdir Command: -p Option
The -p option creates levels of directories under your current directory.
Create a directory structure three levels deep, starting in the HOME directory:
$ cd [Return] . . . . . . . . . . . . . . . . . . Make sure you are in your HOME
directory.
Amir Afzal
UNIX Unbounded, 5th Edition 31 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-11 Your Directory Structure After Adding the Three-Levels Deep Subdirectories
Before
After
Amir Afzal
UNIX Unbounded, 5th Edition 32 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4.5 Removing Directories: The rmdir Command
The rmdir (remove directory) command removes (deletes) the specified directory.
However, it removes only empty directories - directories that contain no subdirectories
Amir Afzal
UNIX Unbounded, 5th Edition 33 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
From the david directory, remove the source subdirectory:
$ cd [Return] . . . . . . . . . . . . . . Change to david directory.
$ rmdir source [Return] . . . . . . Remove the source directory.
rmdir: source: Directory not empty
1. You could not remove the source subdirectory because it was not an
empty directory.
2. rmdir returns an error message if you give a wrong directory name
or if it cannot locate the directory name in the specified pathname.
3. You must be in the parent directory or a higher level of directory
to remove subdirectories (children).
Amir Afzal
UNIX Unbounded, 5th Edition 34 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.4.6 Listing Directories: The ls Command
The ls (list) command is used to display the contents of a specified directory.
1. Remember, a directory listing contains only the names of the files and
subdirectories.
2. If no directory name is specified, the default is your current directory.
3. A filename does not indicate whether it refers to a file or a directory.
4. By default, the output is sorted alphabetically.
Amir Afzal
UNIX Unbounded, 5th Edition 35 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-12 The Directory Structure Used for Command Examples
Amir Afzal
UNIX Unbounded, 5th Edition 36 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Assuming your current directory is david, show the contents of your HOME
directory by typing ls [Return].
$ ls
123
Draft_1
REPORT
memos
myfirst
phones
source
xx
$_
Amir Afzal
UNIX Unbounded, 5th Edition 37 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
In some systems, the output of the ls command is not vertical in one column and
the default format is set to display filenames across the screen.
$ ls
123 Draft_1 REPORT memos myfirst phones source xx
$_
Amir Afzal
UNIX Unbounded, 5th Edition 38 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
You may want to list the contents of directories other than your current directory.
While in your HOME directory david, list files in the source directory:
While in your HOME directory, check whether first.c exists in the source directory:
$ ls source/first.c [Return]. . . . . . Display the first.c filename in the source
directory to see whether it exists.
It does
exist, so the file-name is displayed.
source first.c
$ ls xyz [Return] . . . . . . . . . . . . . Display a file called xyz if it exists. If
it does not exist, you get the error
message.
xyz: No such file or directory
$_ . . . . . . . . . . . . . . . . . . . . . . . . . .You get the prompt sign again.
Amir Afzal
UNIX Unbounded, 5th Edition 39 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
ls Options
When you need more information about your files or you want the listing in a different
Format, use the ls command with options.
Amir Afzal
UNIX Unbounded, 5th Edition 40 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
1. Every option letter is preceded by a minus sign.
2. There must be a space between the command name and the option.
3. You can use pathnames to list files in a directory other than your
working directory.
4. You can use more than one option in a single command line.
Let’s use some of these options and observe their outputs on the screen.
Amir Afzal
UNIX Unbounded, 5th Edition 41 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Option: -l
The most informative option is the -l (long format) option. The listing produced by
the ls command and -l option shows one line for each file or subdirectory and
displays several columns of information for each file.
Amir Afzal
UNIX Unbounded, 5th Edition 42 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5.14 gives you a general idea about what is in each column. Look at each
column and see what type of information it conveys.
Amir Afzal
UNIX Unbounded, 5th Edition 43 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Option: -r
To display the names of the files in your HOME directory in reverse order, type ls -r and
press [Return]
Amir Afzal
UNIX Unbounded, 5th Edition 44 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Option: -C
To display the contents of your current directory in column format, type:
ls -C [Return]
Figure 5-16 The ls Command and the -C Option
Amir Afzal
UNIX Unbounded, 5th Edition 45 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Option: -m
To display the contents of your current directory separated by commas, type ls -m
and press [Return].
Amir Afzal
UNIX Unbounded, 5th Edition 46 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Using Multiple Options
You can use more than one option in a single command line.
For example:
To list all files, including invisible (-a option) files, in long format (-l option), and with the
filenames in reverse alphabetic order (-r option), you type:
ls -alr or ls -a -l –r [Return]
1. You can use one hyphen to start options, but there should be no space
between the option letters.
2. The sequence of the option letters in the command line is not important.
3. You can use one hyphen for each option, but there must be a space
between option letters.
Amir Afzal
UNIX Unbounded, 5th Edition 47 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -m -p
List your HOME directory across the screen and indicate each directory name with a
slash (/).
Amir Afzal
UNIX Unbounded, 5th Edition 48 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -amF
Show all filenames, separated by commas, and to indicate the directory files with
a slash and executable files with an asterisk, do the following:
Amir Afzal
UNIX Unbounded, 5th Edition 49 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -arC
List all the files in your HOME directory, in column format, in reverse order:
Amir Afzal
UNIX Unbounded, 5th Edition 50 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -s -m
List the files in david, separated by commas, and show the size of each file:
Amir Afzal
UNIX Unbounded, 5th Edition 51 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -a -x -s
List all files (including hidden files) in david in column format and also show the file sizes:
Amir Afzal
UNIX Unbounded, 5th Edition 52 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Options: -R -C
Show the directory structure under david in column format:
1. The -R option lists the filenames in the current directory david, which has
three subdirectories: memos, source, and xx.
2. Each subdirectory encountered is shown by its pathname followed by the (:)
(./memos:), and then lists the files in that directory.
3. The pathnames are relative pathnames, starting from your current directory
(the current directory sign is the dot at the beginning of the pathnames).
The command’s options in this example are the uppercase letters R and C.
Amir Afzal
UNIX Unbounded, 5th Edition 53 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Linux Options
As with many other Linux commands, you can use the --help option to get the list
of options for the ls command:
$ ls --help [Return] . . . . . . . . . . Display list of options.
list of options will be displayed
$ _ . . . . . . . . . . . . . . . . . . . Back to the prompt.
The following command sequences show examples using the Linux alternative:
Amir Afzal
UNIX Unbounded, 5th Edition 54 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.5 DISPLAYING FILE CONTENTS
You can always print a file to obtain a hard copy of its contents, or use the vi editor to
open a file and look at it on the screen. You also can use the cat command for this
purpose.
$ cat myfirst yourfirst [Return] . . . Display the myfirst and yourfirst files.
Amir Afzal
UNIX Unbounded, 5th Edition 55 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.6 PRINTING FILE CONTENTS
UNIX provides commands to send your file to the printer, give you the status of
your print job, and let you cancel your print job if you change your mind.
5.6.1 Printing: The lp Command
The lp command sends a copy of a file to the printer. For example you type:
$ lp myfirst [Return] . . . . . . . . . . print myfirst file.
request id is lp1-8054 (1 file) . . . UNIX confirms your request.
There is a space between the command (lp) and the argument (filename).
2. Only one banner page (first page) is produced for this request. However,
each file is printed beginning at the top of a page.
3. The files are printed in the order in which they appear on the command line.
Amir Afzal
UNIX Unbounded, 5th Edition 56 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
lp Options
Table 5.3 shows the options you can use to make your print request more
specific.
Amir Afzal
UNIX Unbounded, 5th Edition 57 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.6.2 Printing: The lpr Command in Linux
Linux is based on BSD (Berkeley Software Distribution) and some of the utilities
and commands provided are different from UNIX.
For example, the lpr command is used to print specified files.
lpr Options
The lpr command provides some of the same options available for the lp
command and some different options. Use the man command to obtain a full
list of the options.
Amir Afzal
UNIX Unbounded, 5th Edition 58 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
The following command sequences shows examples of using the lpr options:
1. Most UNIX and Linux systems provide both lp and lpr commands.
Amir Afzal
UNIX Unbounded, 5th Edition 59 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.6.3 Canceling a Printing Request: The cancel Command
• The cancel command cancels requests for print jobs made with the
lp command.
• To use the cancel command, you need to specify the ID of the printing
job, which is provided by lp, or the printer name.
The following command sequences illustrate the use of the cancel command:
$ lp myfirst [Return] . . . . . . . . . . Print myfirst on the default printer.
request id lp1-6889 (1 file)
$ cancel lp1-6889 [Return]. . . . . . Cancel the current requests on the printer lp1.
request “lp1-6889” canceled
Amir Afzal
UNIX Unbounded, 5th Edition 60 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.6.2 Printing: The lpr Command in Linux
Linux is based on BSD (Berkeley Software Distribution) and some of the utilities
and commands provided are different from UNIX.
For example, the lpr command is used to print specified files.
lpr Options
The lpr command provides some of the same options available for the lp
command and some different options. Use the man command to obtain a full
list of the options.
Amir Afzal
UNIX Unbounded, 5th Edition 61 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.7 DELETING FILES
Use the rm (remove) command to delete files that you do not want to keep
anymore. You specify the filename to delete the file from your working directory,
or specify the pathname to the file you intend to delete if it is in another
directory.
The following command sequence shows how to use the rm command:
$ cd [Return] . . . . . . . . . . . . . . . . . Change to your HOME directory.
$ rm myfirst [Return] . . . . . . . . . . Delete myfirst from your HOME
directory.
$ rm REPORT phones [Return] . . .Delete two files, REPORT and
phones.
$ rm xyz [Return] . . . . . . . .Delete xyz; if the file does not exist, the
system complains by showing an error
message.
rm: file not found
The rm command does not give you any warning, and when a
file is deleted, it is deleted for good!
Amir Afzal
UNIX Unbounded, 5th Edition 62 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-18 The Directory Structure After the File Deletions
Before After
Amir Afzal
UNIX Unbounded, 5th Edition 63 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
rm Options
Like most UNIX commands, rm options modify the capabilities of the rm
command.
Amir Afzal
UNIX Unbounded, 5th Edition 64 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
rm Option: -i
The following command sequence shows examples of the use of the -i
option:
$ pwd [Return] . . . . . . . . . . . Check where you are.
/usr/david
$ ls source [Return]. . . . . . . . List files in the source directory.
first.c first.cpp
$ rm -i source/first.c [Return] . . . . . . . Delete first.c; the system
displays the confirmation
prompt.
Press [y] for yes.
Amir Afzal
UNIX Unbounded, 5th Edition 65 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
Figure 5-18 The Directory Structure After the File Deletions
Before After
Amir Afzal
UNIX Unbounded, 5th Edition 66 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
rm Option: -r
• You can delete an entire directory structure using rm with the -r option.
• Commands like this are what make UNIX an operating system for grownups!
If you want to try the rm -r * command, make sure that you are not in
one of the top-level directories and that you have copied your files into
other directories.
After
Before
Amir Afzal
UNIX Unbounded, 5th Edition 68 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008
5.7.1 Before Removing Files
• Under UNIX, deleting files and removing directories is quite easy.
However, UNIX does not give you any feedback or warning messages.
• Before you know it, the files are deleted, and the remove command is
irreversible.
1. Make sure it is not two o’clock in the morning when you start a major
delete operation.
2. Make sure you know which file you want to delete, and what the content
of that file is.
3. Think twice before pressing [Return] to complete the command.
Amir Afzal
UNIX Unbounded, 5th Edition 69 of 69
Chapter 5: Introduction to the UNIX File System
Copyright ©2008