Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ln(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rm

mv

cp

chmod

link

ln

PURPOSE

     Links files.

SYNOPSIS

     ln [ -f ] file1 [ file2 ... ] target


DESCRIPTION

     The  ln command  links file  to newname  (in the  current
     directory),  or  to  the  same  name  (file)  in  another
     existing directory.   You can link  directories, provided
     the two directories have the same parent.

     If you  are linking a  file to a  new name, you  can list
     only one  file.  If you  are linking to a  directory, you
     can list more than one file.

     Note:  You cannot link files across file systems.

EXAMPLES

     1.  To create another  name (also called an  alias) for a
         file:

           ln  chap1  intro

         This  links  "chap1" to  the  new  name "intro".   If
         "intro"  does not  already  exist, the  file name  is
         created.  If "intro" does exist, the file is replaced
         by a  link to "chap1".   Now "chap1" and  "intro" are
         two  file names  that refer  to the  same file.   Any
         changes made to one also appear in the other.  If one
         name is deleted with del or rm, the file is not actu-
         ally deleted, but remains under the other name.
     2.  To link a file to the same name in another directory:

           ln  index   manual

         This links "index" to the new name "manual/index".
     Note the difference: "intro" in  Example 1 is the name of
     a file; "manual" in Example 2 is a directory that already
     exists.

     3.  To link several files to names in another directory:

           ln  chap2  jim/chap3  /u/manual

         This links "chap2" to  the new name "/u/manual/chap2"
         and "jim/chap3" to "/u/manual/chap3".
     4.  To use ln with pattern-matching characters:

           ln  manual/*  .

         This links  all files in the  directory "manual" into
         the current directory (.), giving them the same names
         they have  in "manual".   Note that  you must  type a
         space between the asterisk and the period.

RELATED INFORMATION

     The following commands:  "rm,"  "mv," and "cp."

     The chmod and  link system calls in  AIX Operating System
     Technical Reference.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026