What is the difference between the link and ln commands?
6,431
Solution 1
link used solely for hard links, calls the link() system function and doesn't perform error checking when attempting to create the link
ln has error checking and can create hard and soft links
Solution 2
The link
command creates a hard link to a file.
According to the manual page, it is the same as:
$ ln --directory --no-target-directory FILENAME LINKNAME
See man link
or info coreutils 'link invocation'
for more details.
Related videos on Youtube
![Qwertie](https://i.stack.imgur.com/DUiG3.jpg?s=256&g=1)
Author by
Qwertie
Updated on September 18, 2022Comments
-
Qwertie almost 2 years
From the man pages:
ln - make links between files
and
link - call the link function to create a link to a file
These seem to do the same thing however
ln
takes a lot of options as well.Is
link
just a very basicln
? Is there any reason to use link over ln?