ln
FilesFundamentals In simulator In real LinuxCreate hard or symbolic links
Name: ln = link
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
ln creates links. By default it makes a hard link: another name for the same data (the same inode); the data survives as long as any name remains. Hard links can't cross file systems or point to directories.
-s makes a symbolic (soft) link: a small file holding a path, like a shortcut. It can cross file systems and point to directories, but breaks if the target is removed.
Syntax
ln [OPTION]... TARGET LINK_NAMECommon options
| -s / --symbolic | Create a symbolic (soft) link; the usual choice |
| -f / --force | Remove an existing destination |
| -n / --no-dereference | Treat a link to a directory as a normal file |
| -r / --relative | Write a relative path into the symbolic link (it survives moving the whole tree) |
| -i / --interactive | Ask before replacing an existing file |
| -v / --verbose | Print each link made |