Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]



    ln is a standard Unix program used to create links (link) between files.


        Ln (Unix)
            Link files
            Specification
            Usage
            Examples
            See also
                Manual pages

    top

    Link files
    Links allow more than one file to refer to the same file, elsewhere.

    There are two types of links, both of which are created by ln:
      symbolic links, which refer to a symbolic path indicating the abstract location of another file, and
      hard links, which refer to the specific location of physical data.

    These links behave differently when the source of the link (what is being linked to) is moved or removed. Symbolic links are not updated (they merely contain a string which is the pathname of its target); hard links always refer to the source, even if moved or removed.

    top

    Specification
    The Single Unix Specification (SUS) specifies the behaviour that a link or links (either symbolic or hard) will be created where specified that will link to the target file (or directory) specified.

    More precisely, ln can be invoked in one of two ways: two arguments -- first an argument specifying the source file then the target, or multiple (greater than two) arguments, specifying firstly a number of source files, then a directory in which all the links are to be created. In the latter invocation, the names of the links will be that of the source file. This invocation will be assumed if the last argument is a directory. If invoked in the latter form, ln's behaviour is not specified (it is implementation-defined).

    ln is specified to use behaviour identical to that of the standard unlink() and link() functions.

    top

    Usage
    The SUS mandates for ln two options: -f, which will force removal of existing files to allow the link to be created, and -s, to specify symbolic links.

    Other Unix and Unix-like operating systems may add extra options. GNU ln adds options such as -b to back up files before creating links, -v to print out the names of each files before links are created, and others. BSD ln adds -h, preventing ln from descending into targets whose symlinks point to directories

    top

    Examples

    ln xyz abc

    would have the effect of creating a hard link called abc that points to the same data as the existing file xyz.

    top

    See also


    top

    Manual pages





     
    Search more:
     

       
    Source Privacy License Download Contact Us Atlas
    Scientus.org Dictionary (Yet Another Wiki) RC : 1.39
    MIT OpenCourseWare
    This article is licensed under the GNU Free Documentation License [copyleft]. It uses material from the Wikipedia article "Ln (Unix)". link