Information Technology Reference
In-Depth Information
Types of Links
As previously mentioned, files and directories are linked into a directory. This
link is stored as an entry in the directory and provides a reference by which
the file or directory can be located and accessed.
The directory entry is actually a pointer to the location of the file or direc-
tory within the file system and is referred to as a hard link . Because this link
points to a file or directory based on its location in the file system, links can-
not be used to point to a file or directory in a different file system. Thus, a
hard link implies the file or directory is located in the current file system.
The soft link or symbolic link provides a mechanism to reference a file or
directory on another file system. Instead of pointing to a location in the file
system, the directory entry contains the full pathname of another file or
directory. Because the reference is not based on location, symbolic links can
be used to point to files and directories on other file systems. This allows for
creating multiple pathnames and filenames on different file systems that all
point to the same file or directory.
The link(1M) and ln(1) commands can be used to create hard links.
However, only the ln command can be used to create symbolic links (using
the -s command-line argument). The unlink(1M) command can be used to
delete hard or soft links. When all hard links to a file or directory are delet-
ed, the file or directory is removed. Also the rm(1) and rmdir(1) commands
can also be used to delete hard or soft links.
The Unix Directory Tree
The Unix data storage facility is a collection of directories that contain files
and other directories. These files and directories are organized in a hierar-
chical structure with the root ( / ) directory as the starting point. Thus, the
Unix data storage is organized in the form of an inverted tree with directo-
ries being branches and files being leaves.
Metacharacters
Metacharacters are characters or combinations of characters that can be used
to represent all or portions of directory or filenames. Metacharacters allow a
short phrase to represent a longer directory/filename or even a series of
directory/filenames. All three standard Solaris 9 login shells (Bourne, C, and
Korn) support the metacharacters listed in Table 6.4.
Search WWH ::




Custom Search