LN(1) General Commands Manual LN(1)NAME
ln, clone - create a link to a file
SYNOPSIS
ln [-ifmrRvx] file [name]
ln [-ifrRvx] file ... dir
clone [-ifmvx] file [name]
OPTIONS -i Ask if ok to remove a file
-f Remove existing links
-m Merge trees, disable the into-a-directory trick
-rR Recursively link a directory tree
-v Display what ln is doing
-x Do not cross device boundaries
EXAMPLES
ln file newname # Make newname a synonym for file
ln /usr/games/chess # Create a link called chess
DESCRIPTION
A directory entry is created for name . The entry points to file . Henceforth, name and file can be used interchangeably. If name is not
supplied, the last component of file is used as the link name. If more than one file is supplied or the name refers to an existing direc-
tory, links will be created in that directory. An existing name will not be removed unless the -i or -f flag is specified.
Clone is a convenient synonym for ln -fmr to create a so-called "link farm", a directory full of links to the original tree.
SEE ALSO cp(1), link(2), unlink(2).
LN(1)
Check Out this Related Man Page
LN(1) General Commands Manual LN(1)NAME
ln - make links
SYNOPSIS
ln [ -s ] sourcename [ targetname ]
ln [ -s ] sourcename1 sourcename2 [ sourcename3 ... ] targetdirectory
DESCRIPTION
A link is a directory entry referring to a file; the same file (together with its size, all its protection information, etc.) may have
several links to it. There are two kinds of links: hard links and symbolic links.
By default ln makes hard links. A hard link to a file is indistinguishable from the original directory entry; any changes to a file are
effective independent of the name used to reference the file. Hard links may not span file systems and may not refer to directories.
The -s option causes ln to create symbolic links. A symbolic link contains the name of the file to which it is linked. The referenced
file is used when an open(2) operation is performed on the link. A stat(2) on a symbolic link will return the linked-to file; an lstat(2)
must be done to obtain information about the link. The readlink(2) call may be used to read the contents of a symbolic link. Symbolic
links may span file systems and may refer to directories.
Given one or two arguments, ln creates a link to an existing file sourcename. If targetname is given, the link has that name; targetname
may also be a directory in which to place the link; otherwise it is placed in the current directory. If only the directory is specified,
the link will be made to the last component of sourcename.
Given more than two arguments, ln makes links in targetdirectory to all the named source files. The links made will have the same name as
the files being linked to.
SEE ALSO rm(1), cp(1), mv(1), link(2), readlink(2), stat(2), symlink(2)4th Berkeley Distribution April 10, 1986 LN(1)
hard links
1) why isnt it possible to link across file system boundaries
2) when we removed one link , how will the other link be affected?
symbolic links
1) why is it possible to create symbolic links but not hard links across file system boundaries?
thanks (2 Replies)
hi all,
i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ...
specifically, i'd like to:
(1) specify a src directory
(2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs
(3) clone that same, empty dir hierarchy to... (2 Replies)
:) :) hi gurus,
I have created a directory called "Proj" in the root directory.
I then created a file called "dboper.prg" in that directory.
I have given file permissions and directory permissions .
But when executing the file dboper.prg ($ dboper.prg) from being in the proj directory,i am ... (2 Replies)
I've been searching and cannot seem to find anywhere online a link to a manual for Glance.
Does anyone have a link to this? I searched in here already and the links I found on a post from 2002 were dead.
And more to the point, do you know if you can use Glance to see Disk I/O per logical... (2 Replies)
How can I remove all links (and just the links) from a file hierarchie (recursively)? With unlink I don't see any possibility to do that.
Thanks! (4 Replies)
I need to put a soft link in each users home directory that is somethink like this
workspace --> /vol/workspace
Any suggestions what is the easiest way to accomplish this? (3 Replies)
Hi Experts,
Is there any way to link the contents (subdirectories/files) of a existing directory A to another existent directory B..
The relative path of /root/Directory A/
Directory A
|__ Subdirectory A1
|__File A
|__File B
|__ Subdirectory A2
|__File A
... (6 Replies)
Hello,
I am having a problem to create a shortcut in a directory linked to another directory in my home directory. For example, I would like to create a shortcut 'outputs', which directly links to the real 'outputs' in my home directory. So, I was wondering if ln is the correct command in this... (5 Replies)
Hi All,
I have directory "A" on server "1".
I also have directory "B" on Server "2"
I need to link these 2 directories "A" and "B" which are across servers.
Is it possible?
If so, can somebody help me on this?
Thanks in advance.
Mugundan (2 Replies)
Hi -
Our system admin cannot create a link to NAS with one particular name but he can create with other names.
What might be the cause?
Regards
---------- Post updated at 11:30 AM ---------- Previous update was at 11:29 AM ----------
It says permission denied. (2 Replies)
Hi guys,
I need a solution to copy files and folders without using cp-r , cp-R or any variants. So i need to code it manually. I allready have a loop
Avans Highschool Breda the Netherlands
#!bin/bash
IFS=$'\n'
if test "$1" = ""
then
wd=pwd
else
wd=$1
fi
... (7 Replies)
hi:
i am trying to understand the concept of the output of ls command, specifically "number of links" for a directory and got utterly confused:
1) when i made first directory in my home directory:
dave@host:~:$ mkdir dir_l1
from the perspective of home directory, the link number for... (2 Replies)
Hi Chess Players,
Which Online Resources (and Software) Do You Use and Why?
As for me, I use chessgames.com and chessbase.com; but currently I'm using chessgames.com the most; I like exploring openings in the chessgames.com opening explorer.
For analysis on the desktop (Mac) or iPhone I... (8 Replies)