GNU bug report logs -
#79060
ln documentation 2nd form does not work
Previous Next
Full log
View this message in rfc822 format
On Sun, 20 Jul 2025 23:21:09 +1000, Mason Wong <masonwong1999 <at> gmail.com>
wrote:
> According to the ln documentation ( ln(1) - Linux manual page
> <https://man7.org/linux/man-pages/man1/ln.1.html>)
>
> [image: image.png]
> The documentation states that you should be able to do something like *ln
> a.txt* (where a.txt is just some arbitrary file). However, this is
> misleading because something like this cannot be done:
The problem is that you're running the command in the same directory as the
source, so it correctly cannot create a link to it since an object with the
same name already exists (ie, the file itself). This is the same that would
happen even with the two-argument form of ln, if an object with the same
name already exists;
$ touch b
$ ln -s /bin/ls b
ln: failed to create symbolic link 'b': File exists
Try linking to an object that doesn't live in the same directory.
$ rm b
$ ln -s /bin/ls
$ ls -l
lrwxrwxrwx 1 davide davide 7 Jul 20 17:18 ls -> /bin/ls
--
D.
This bug report was last modified 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.