[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

link Command

Purpose

Performs a link subroutine.

Syntax

link File1 File2

Description

The link command performs the link subroutine on a specified file. The link command does not issue error messages when the associated subroutine is unsuccessful; you must check the exit value to determine if the command completed normally. It returns a value of 0 if it succeeds, a value of 1 if too few or too many parameters are specified, and a value of 2 if its system call is unsuccessful.

Attention: The link command allows a user with root user authority to deal with unusual problems, such as moving an entire directory to a different part of the directory tree. It also permits you to create directories that cannot be reached or escaped from. Be careful to preserve the directory structure by observing the following rules:
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. Use the link Dir Dir/. command where the Dir parameter is the name of the damaged directory. However, use this only as a last resort when the directory is destroyed and the fsck command is unable to fix it.

Examples

To create an additional link for an existing file1, enter:

link file1 file2

Files

/usr/sbin/link Contains the link command.

Related Information

The fsck command, unlink command, ln command.

The link subroutine, unlink subroutine.

The File Systems Overview for System Management in AIX Version 4.3 System Management Guide: Operating System and Devices explains file system types, management, structure, and maintenance.

The Files Overview in AIX Version 4.3 System User's Guide: Operating System and Devices provides information on working with files.

The Directory Overview in AIX Version 4.3 System User's Guide: Operating System and Devices explains working with directories and path names.


[ Previous | Next | Contents | Glossary | Home | Search ]