I need locate program file in user's PATH. I found few solution, the best are command
and type
.
Which is better, faster, UNIX-like way and why?
command -v <application>
type -p <application>
I need locate program file in user's PATH. I found few solution, the best are command
and type
.
Which is better, faster, UNIX-like way and why?
command -v <application>
type -p <application>
The variant command -v
is the defined in the POSIX standard,
so it is exactly the "UNIX-like way to do it".
For the standard, see POSIX - Shell & Utilities - command
For all the details, and still much more details: Why not use "which"? What to use then?
command -p ${this is run with a path guaranteed to find all standard utilities}
– mikeserv Aug 16 '14 at 17:23