You are not logged in.

#1 2020-03-06 10:33:25

edriv
Member
Registered: 2013-03-13
Posts: 13

[SOLVED] To understand which executable is run after a bash command

I want to understand which executable is run after I type a specific command.

I'm not a complete newbie so I know about the PATH variable and the which command.
But the issue is that they're not giving the right answer.

More specifically, there was an older version of the file manager thunar located in /usr/local/bin.
I deleted it because when firing the command "thunar" it pointed to that executable instead of the one in /usr/bin.
But now I found that bash is still trying to launch that file:

[elda@PCCASA ~]$ which -a thunar
/usr/bin/thunar
[elda@PCCASA ~]$ thunar
bash: /usr/local/bin/thunar: No such File or directory

I've checked aliases too. No idea of what's going on hmm

Last edited by edriv (2020-03-06 10:37:57)

Offline

#2 2020-03-06 10:35:55

edriv
Member
Registered: 2013-03-13
Posts: 13

Re: [SOLVED] To understand which executable is run after a bash command

Solved, it was sufficient to re-start bash. neutral

Offline

#3 2020-03-06 10:52:50

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,708
Website

Re: [SOLVED] To understand which executable is run after a bash command

FYI: This is because bash performs path caching.
https://www.unix-ninja.com/p/How_do_I_c … xecutables
I.e.

 hash -d thunar

would have sufficed.

Last edited by schard (2020-03-06 15:37:37)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#4 2020-03-06 15:09:53

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] To understand which executable is run after a bash command

https://unix.stackexchange.com/question … o-use-then

tl;dr Don't ever use "which" for any reason, but if you are in bash, then you can use "type -a".

(yes, this is not strictly related to your problem, since it would not report /usr/local/bin/thunar either. But "which" still sucks.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB