LINK, UNLINK(8,C) AIX Commands Reference LINK, UNLINK(8,C)
-------------------------------------------------------------------------------
link, unlink
PURPOSE
Performs a link or unlink system call.
SYNTAX
link -- file1 -- file2 --|
unlink -- file --|
DESCRIPTION
The link and unlink commands perform the corresponding system calls of the same
name on the specified file, abandoning all error checking. These commands can
be run only by a user operating with superuser authority (see "su"). You
should be familiar with the link and unlink system calls described in AIX
Operating System Technical Reference.
The link and unlink commands do not issue error messages when the associated
system call fails; you must check the exit value to determine if the command
completed normally. Each command returns a 0 if it succeeds, a 1 if you
specify too few or too many parameters, or a 2 if its system call fails.
Warning: The link and unlink commands allow the superuser to deal with unusual
problems, such as moving an entire directory to a different part of the
directory tree. They also permit you to create directories that cannot be
reached or escaped from. Be careful to preserve directory structure. To
preserve directory structure observe the following rules:
o Be certain every directory has a . (dot) link to itself.
o Be certain every directory has a .. (dot dot) link to its parent directory.
o Be certain every directory has no more than one link to it from above.
o Be certain every directory is accessible from the root of its file system.
Note: If the . (dot) entry has been destroyed and the fsck command is unable
to repair it (a rare occurrence), you can use the link command to
restore the . (dot) entry of the damaged directory with the command link
dir dir/., where dir is the name of the damaged directory. However use
this command only as a last resort; that is, when the directory is
destroyed and fsck is unable to fix it.
RELATED INFORMATION
See the following commands: "ln" and "fsck, dfsck."
Processed November 8, 1990 LINK, UNLINK(8,C) 1
LINK, UNLINK(1,C) AIX Commands Reference LINK, UNLINK(1,C)
See the link and unlink system calls in AIX Operating System Technical
Reference.
Processed November 8, 1990 LINK, UNLINK(1,C) 2