LN(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– LN(1) β€” ln

okay bestie, sit down, we're learning ln today and honestly? it's giving "tiny command, huge power". ✨

🌸 NAME

ln β€” make links between files πŸ”—


πŸŽ€ SYNOPSIS

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

πŸ¦‹ DESCRIPTION

Okay so there's four whole ways to run this thing, and each one is a different mood:

  1. the 1st form β€” make a link to TARGET with the name LINK_NAME πŸ’«
  2. the 2nd form β€” make a link to TARGET in the current directory (right where you're standing, no cap)
  3. the 3rd and 4th forms β€” make links to each TARGET in DIRECTORY πŸ—‚οΈ

By default you get hard links, but if you say --symbolic you get symbolic links instead. And by default, each destination (that's the name of the new link) should not already exist β€” the command is NOT gonna just bulldoze stuff for you, no ma'am. πŸ™ˆ

When you're creating hard links, every single TARGET must exist. Symbolic links on the other hand can hold arbitrary text β€” like, literally whatever β€” and if it ever gets resolved later, a relative link is interpreted in relation to its parent directory. iykyk. 🧚

Mandatory arguments to long options are mandatory for short options too. (This applies everywhere, forever, it's just how GNU works bestie.)

✨ the options, one by one πŸ’…

  • --backup[=CONTROL] β€” make a backup of each existing destination file 🫢
  • -b β€” like --backup but does not accept an argument
  • -d, -F, --directory β€” allow the superuser to attempt to hard link directories, if supported by the system πŸ‘‘
  • -f, --force β€” remove existing destination files πŸ”₯
  • -i, --interactive β€” prompt whether to remove destinations πŸ™‹
  • -L, --logical β€” dereference *TARGET*s 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 🌈
  • -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 πŸ—£οΈ
  • --help β€” display this help and exit
  • --version β€” output version information and exit

πŸ“ about them backups

The backup suffix is '~', unless you set it with --suffix or the SIMPLE_BACKUP_SUFFIX environment variable. And the version control method (the vibe of your backups, basically) can be picked via the --backup option or through the VERSION_CONTROL environment variable. Here are the values, bestie:

  • none, off β€” never make backups (even if --backup is given) πŸ’€
  • numbered, t β€” make numbered backups πŸ”’
  • existing, nil β€” numbered if numbered backups exist, simple otherwise
  • simple, never β€” always make simple backups

🌟 one more thing, this one matters

Using -s ignores -L and -P. Otherwise, the last option specified controls behavior when a TARGET is a symbolic link, defaulting to -P.


πŸ’œ AUTHOR

Written by Mike Parker and David MacKenzie. iconic behavior, honestly. πŸ‘‘


😭 REPORTING BUGS

Found a bug? Tell the people:


πŸ”— SEE ALSO


Packaged by Ubuntu (9.10-1ubuntu2), 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.

okay periodt, that's the whole page bestie β€” this one's from GNU coreutils 9.10, dated August 2026, and it lives in the LN(1) section of the manual. now go make some links and slay πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from