xref: /illumos-gate/usr/src/man/man8/link.8 (revision bbf21555)
te
Copyright 1989 AT&T
Copyright (c) 2002Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
LINK 8 "Oct 9, 2002"
NAME
link, unlink - link and unlink files and directories
SYNOPSIS

/usr/sbin/link  existing-file new-file

/usr/xpg4/bin/link  existing-file new-file

/usr/sbin/unlink file
DESCRIPTION

The link and unlink commands link and unlink files and directories. Only super-users can use these commands on directories.

Use link to create a new file that points to an existing file. The existing-file and new-file operands specify the existing file and newly-created files. See OPERANDS.

link and unlink directly invoke the link(2) and unlink(2) system calls, performing exactly what they are told to do and abandoning all error checking. This differs from the ln(1) command. See ln(1).

While linked files and directories can be removed using unlink, it is safer to use rm(1) and rmdir(1) instead. See rm(1) and rmdir(1).

If the existing file being hard linked is itself a symbolic link, then the newly created file (new-file) will be a hard link to the file referenced by the symbolic link, not to the symbolic link object itself (existing-file).

OPERANDS

The following operands are supported: existing-file

Specifies the name of the existing file to be linked.

file

Specifies the name of the file to be unlinked.

new-file

Specifies the name of newly created (linked) file.

ENVIRONMENT VARIABLES

See environ(7) for descriptions of the following environment variables that affect the execution of link: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Standard
SEE ALSO

ln (1), rm (1), link (2), unlink (2), attributes (7), environ (7), standards (7)