Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
ln
Synopsis
ln [options] sourcename [destname]
ln [options] sourcenames destdirectory
Description
Create pseudonyms (links) for files, allowing them to be accessed by different names. In the first form, link sourcename to destname, where destname is usually a new filename, or (by default) the current directory. If destname is an existing file, it is overwritten; if destname is an existing directory, a link named sourcename is created in that directory. In the second form, create links in destdirectory, each link having the same name as the file specified.
Options
- -b, --backup
Back up files before removing the originals.
- -d, -F, --directory
Allow hard links to directories. Available to privileged users.
- -f, --force
Force the link (don’t prompt for overwrite permission).
- --help
Print a help message and then exit.
- -i, --interactive
Prompt for permission before removing files.
- -n, --no-dereference
Replace symbolic links to directories instead of dereferencing them. --force is useful with this option.
- -s, --symbolic
Create a symbolic link. This lets you link across filesystems and also see the name of the link when you run ls -l (otherwise, there’s no way to know the name that a file is linked to).
- -S suffix, --suffix suffix
Append suffix to files when making backups, instead of the default ~.
- -v, --verbose
Verbose mode.
- --version
Print version information and then exit.
- -V, --version-control value
Control the types of backups made. The acceptable values for version-control are: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access