Re:fd: A simple, fast and user-friendly alternative to 'find'
by tavianator on Wednesday March 19, 2025 @11:38AM
(#43413447)
At least with GNU coreutils, you can use `-r`/`--relative`
Re:fd: A simple, fast and user-friendly alternative to 'find'
by stouset on Wednesday March 19, 2025 @12:22PM
(#43414067)
TIL!
Re:fd: A simple, fast and user-friendly alternative to 'find'
by bbkane on Wednesday March 19, 2025 @01:20PM
(#43414785)
I've never internalized this, so I usually stick to using absolute paths...
Not a solution for all problems, but it works for me most of the time.
Re:fd: A simple, fast and user-friendly alternative to 'find'
by stouset on Wednesday March 19, 2025 @03:56PM
(#43416582)
Absolute paths will break if, for example, the target and source are in the same directory but you move the directory.
Sometimes you semantically want absolute paths (I want to symlink a thing to /bin/foo), sometimes you want relative paths (I want to symlink a thing to something in a nested directory).
If the first argument isn’t an absolute path, it must be relative to the second argument, and not to pwd.
./bar/baz will be a symlink whose literal contents are `./foo` so it will look for foo in the same directory (bar), rather than in bar’s parent directory.This is totally backwards from how other utilities behave. Which is completely understandable if you know what it’s doing under the hood. But it is counterintuitive and surprising.