Debian's which hunt
Debian's which hunt
Posted Nov 1, 2021 15:38 UTC (Mon) by NYKevin (subscriber, #129325)In reply to: Debian's which hunt by Deleted user 129183
Parent article: Debian's which hunt
Posted Nov 16, 2021 14:07 UTC (Tue)
by nye (subscriber, #51576)
[Link] (5 responses)
$ mv old new
These are all the same - why is that against all common sense? Are you saying that you think ln should be changed to work differently from the others, or that they should all have the new file before the source file, like memcpy()?
Posted Nov 16, 2021 14:20 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (4 responses)
Posted Nov 16, 2021 15:50 UTC (Tue)
by Wol (subscriber, #4433)
[Link] (1 responses)
My brain thinks that copy, mv, etc all take a "copy" of the first argument, and leave it in the second.
ln is the "wrong" way round, in that it leaves a copy of the second argument in the first.
THAT is why there is no such thing as "intuitive" software - what you think of as bleeding obvious, I think of as "who the hell designed that monstrosity!" (and vice versa, of course :-)
Cheers,
Posted Nov 16, 2021 16:47 UTC (Tue)
by jezuch (subscriber, #52988)
[Link]
Or is the mental model "create a link <here> to <this file>" instead of "link <this file> <there>"? Perhaps the former makes more sense to native speakers ;)
Posted Nov 16, 2021 16:49 UTC (Tue)
by nybble41 (subscriber, #55106)
[Link] (1 responses)
If you use `ln --relative --symlink` or `ln -rs` then the symlink target is resolved relative to the current directory (so you can use your tab completion) and the proper relative path is placed in the symlink. The --relative option was introduced in GNU coreutils 8.16.
Posted Nov 16, 2021 21:35 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link]
Debian's which hunt
$ cp old new
$ ln old new
Debian's which hunt
Debian's which hunt
Wol
Debian's which hunt
Debian's which hunt
$ mkdir -p a/b/c
$ touch test.file
$ ln -rs test.file a/b/c
$ ls -l a/b/c
total 0
lrwxrwxrwx 1 user group 18 Nov 16 00:00 test.file -> ../../../test.file
Debian's which hunt