[Novalug] search path

William Sutton william@trilug.org
Wed Feb 5 08:13:38 EST 2014


And don't forget about `locate`.

William Sutton

On Wed, 5 Feb 2014, James Ewing Cottrell III wrote:

> And who knows which is which, and who is who?
>
> 'which' has traditionally been a csh shell script, meaning that it would
> look at csh aliases as well as look thru $PATH. However, recent versions
> of Linux have fixed that.
>
> Still, the command 'type' is a better answer, since in is builtin to
> bash. I believe that 'type' is also an alias for 'whence', which is the
> ksh builtin. I'd hazard a guess that which or whence might also be a zsh
> builtin, but if one of us is going to have to read the manual, it might
> as well be you.
>
> Try tying the command twice, as in 'type type', 'which which', or
> 'whence whence' and see what happens.
>
> JIM
>
> P.S. I just made this up...
>
> knock knock
> who's there?
> which
> which who?
> who is /bin/who
>
> On 2/3/2014 6:23 PM, Peter Larsen wrote:
>> Use 'which fwknop' - it will return the execution path. Be aware, that
>> once you have run the program, even if you change the path for that
>> session you'll be executing the old one. So if you find the same
>> executable in multiple places, change your profile setup fixing the PATH
>> seeting, log out (or close the terminal) and log in again to get the
>> profile re-executed.
>>
>> Btw. verify that /usr/bin and /usr/bin/X11's instances are both refering
>> to the same inode (hard link). If not, you're asking for trouble. Rename
>> one of them so there's no doubt which program you're running.
>>
>>
>
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>



More information about the Novalug mailing list