bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#79060: ln documentation 2nd form does not work


From: Davide Brini
Subject: bug#79060: ln documentation 2nd form does not work
Date: Sun, 20 Jul 2025 17:19:13 +0200

On Sun, 20 Jul 2025 23:21:09 +1000, Mason Wong <masonwong1999@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]