
ln(1) | ln(1) |
NAME
ln - link ®les and directories
SYNOPSIS
ln
ln
ln
DESCRIPTION
The ln command links:
∙®le1 to a new or existing new_®le,
∙®le1 to a new or existing ®le named ®le1 in existing dest_directory,
∙®le1, ®le2, ... to new or existing ®les of the same name in existing dest_directory,
∙directory1, directory2, ... to new directories of the same name in existing dest_directory,
∙or it creates symbolic links between ®les or between directories.
If links are to dest_directory, corresponding ®le or directory names in that directory are linked to ®le1, ®le2, ..., or directory1, directory2, ..., etc., as appropriate. If two or more existing ®les or directories (excluding destination ®le name new_®le) are speci®ed, the destination must be a directory. If new_®le already exists as a regular ®le (or link to another ®le), its contents (or the existing link) and its ACL are destroyed only if the
If the
cannot unlink new_®le
(even if the ®le is an ordinary ®le and not a link to another ®le). When asking for permission to overwrite an existing ®le or link, ln prints the mode (see chmod(2) and Access Control Lists below), followed by the ®rst letters of the words yes and no in the current native language, prompting for a response, and reading one line from the standard input. If the response is af®rmative and is permissible, the operation occurs; if not, the command proceeds to the next source ®le, if any.
Hard links are created with the same ownerships and permissions as the ®le or directory to which they are linked. If ownership or permissions are changed on a link or ®le, the same changes appear on corresponding hard links. The ln command does not permit hard links to a directory.
Symbolic links are created with the ownership of the creator and the permissions are of the creator's current umask. Once created, the symbolic link ownership and permissions will not change, since the mode and ownership of the symbolic link is ignored by the system.
If ®le1 is a ®le and new_®le is a link to an existing ®le or an existing ®le with other links, new_®le is disassociated from the existing ®le and links and linked to ®le1. When ln creates a link to a new or existing ®le name, ownerships and permissions are always identical to those for the ®le to which it is linked. If chown, chgrp, or chmod is used to change ownership or permissions of a ®le or link, the change applies to the ®le and all associated links. The last modi®cation time and last access time of the ®le and all associated links are identical (see chown(1) and chmod(1)).
For a discussion of symbolic links, see symlink(4).
Options
The ln command recognizes the following options:
− 1 − | Section 1−453 |
l