-f
Causes the ln command to replace any destination paths that already exist.
If a destination path already exists and the -f flag is not specified, the ln
command writes a diagnostic message to standard error without
creating a new link and continues to link the remaining SourceFiles.
-s
Causes the ln command 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 operation is performed on the link. A stat call on a
symbolic link returns the linked-to file; an lstat call must be done to
obtain information about the link. The readlink call may be used to
read the contents of a symbolic link. Symbolic links can span file
systems and refer to directories.
Notes:
1.You cannot link files across file systems without using the -s flag.
2.If TargetDirectory is already a symbolic link to a directory, then the
ln command treats the existing target as a file. This means that a
command such as ln -fs somepath/lname symdir
will not follow the existing symbolic link of symdir, instead it will
create a new symbolic link from somepath/lname to symdir.
To create another link (alias) to a file, enter:
ln -f 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. Then both the chap1 and intro file names will refer to the same file.
Any changes made to one also appear in the other. If one file name is deleted
with the del or the rm command, the file is not completely deleted since
it remains under the other name.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.