Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • find is at least as problematic as realpath. They are both defined in POSIX, but find is known to have multiple, slightly incompatible implementations. Commented Mar 23, 2023 at 3:07
  • But that simple syntax should be available widely. realpath may not be installed by default. At least it happens on one of my testing VMs Commented Mar 23, 2023 at 5:25
  • find is also resource intensive and potentially returns multiple results when there are more than one file with the same name. There are better options, like Python/Perl one-liners. realpath seems to be absent on macOS and some old Linux distros from a decade ago. Otherwise, it's provided by coreutils, busybox, FreeBSD, NetBSD, OpenBSD. Commented Mar 23, 2023 at 14:19