LN(1)

okay bestie, sit down, hydrate, because today we're talking about ln โ€” a User Commands girly who literally just makes links between files. that's it. that's the whole job. and she ate. โœจ


๐ŸŒธ NAME ๐ŸŒธ

ln โ€” make links between files ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

four whole forms, she's versatile, she contains multitudes:

ln [OPTION]... [-T] TARGET LINK_NAME
ln [OPTION]... TARGET
ln [OPTION]... TARGET... DIRECTORY
ln [OPTION]... -t DIRECTORY TARGET...

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so here's the tea, and it's giving four flavors:

  • form 1 โ€” you make a link to TARGET and it gets the name LINK_NAME.
  • form 2 โ€” you make a link to TARGET right in the current directory. cozy.
  • forms 3 and 4 โ€” you make links to each TARGET, all of them, every single one, inside DIRECTORY.

by default she makes hard links (no cap), and symbolic links only if you say --symbolic. by default, each destination โ€” that's the name of the new link โ€” should not already exist. she's not trying to overwrite your whole life, okay?

when you're making hard links, every single TARGET must exist. no exceptions, she will simply refuse. symbolic links though? those can hold arbitrary text โ€” literally whatever. and if someone resolves them later, a relative link gets interpreted in relation to its parent directory. iykyk. ๐Ÿงš

mandatory arguments to long options are mandatory for short options too. that's just how it is. it's giving equal treatment. periodt.

๐ŸŽ€ the flags, one by one ๐ŸŽ€

  • --backup[=CONTROL] โ€” make a backup of each existing destination file. she's considerate like that.
  • -b โ€” like --backup but she does not accept an argument. no CONTROL for you.
  • -d, -F, --directory โ€” allow the superuser to attempt to hard link directories, if supported by the system. yes the wording is doing a lot of work there, we don't make the rules ๐Ÿ’€
  • -f, --force โ€” remove existing destination files. bye bye. ๐Ÿ˜ญ
  • -i, --interactive โ€” prompt whether to remove destinations. she asks first, she's polite ๐Ÿซถ
  • -L, --logical โ€” dereference TARGETs that are symbolic links
  • -n, --no-dereference โ€” treat LINK_NAME as a normal file if it is a symbolic link to a directory
  • -P, --physical โ€” make hard links directly to symbolic links
  • -r, --relative โ€” with -s, create links relative to link location
  • -s, --symbolic โ€” make symbolic links instead of hard links. the soft girl option โœจ
  • -S, --suffix=SUFFIX โ€” override the usual backup suffix
  • -t, --target-directory=DIRECTORY โ€” specify the DIRECTORY in which to create the links
  • -T, --no-target-directory โ€” treat LINK_NAME as a normal file always
  • -v, --verbose โ€” print name of each linked file. she's a yapper and we love her for it ๐Ÿ’ฌ
  • --help โ€” display this help and exit
  • --version โ€” output version information and exit

๐ŸŒˆ backup behavior, the lore ๐ŸŒˆ

the backup suffix is '~' โ€” cute, right? unless you set it with --suffix or the SIMPLE_BACKUP_SUFFIX environment variable. the version control method can be picked via the --backup option or through the VERSION_CONTROL environment variable. here are the values, bestie, memorize them:

  • none, off โ€” never make backups (even if --backup is given). she's in her "no thoughts head empty" era.
  • numbered, t โ€” make numbered backups
  • existing, nil โ€” numbered if numbered backups exist, simple otherwise
  • simple, never โ€” always make simple backups

โญ the rule that controls the chaos โญ

using -s ignores -L and -P. gone. irrelevant. otherwise, the last option specified controls behavior when a TARGET is a symbolic link, and it defaults to -P. last one wins, that's the law ๐Ÿ‘‘


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Written by Mike Parker and David MacKenzie. absolute icons, honestly. ๐Ÿ™Œ


๐Ÿ› REPORTING BUGS ๐Ÿ›

found a bug? spill it, don't hold it in:


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. read it and weep (affectionately) ๐Ÿ’€


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

full documentation <https://www.gnu.org/software/coreutils/ln> โ€” or available locally via: info '(coreutils) ln invocation'


and that's the whole page, bestie!! this was GNU coreutils 9.12, dated September 2026, and she is serving link energy like nobody's business. go make some links, drink some water, ily ๐Ÿ’–๐ŸŽ€๐ŸŒธ๐Ÿฆ‹โœจ๐Ÿ’…

๐Ÿ“ฆ where this page comes from