Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I find where a executable is present in macosx?

Tags:

bash

macos

I have a command called youtube-dl .. but dont know where it is installed.. i can run it from shell.. how do i find where it is installed ? which youtube-dl doesnt say anything..

like image 700
Deepan Chakravarthy Avatar asked Aug 04 '10 09:08

Deepan Chakravarthy


People also ask

How do I find the location of an executable in Linux?

Please note that executables can also be located in /opt//bin and in /opt//sbin. Further, there are often in /usr/libexec also.


3 Answers

Bash has a command that will show whether a command is an alias, a function or an executable in your path (and, if so, where):

type -a youtube-dl

It's much better than which which doesn't include aliases or functions.

like image 112
Dennis Williamson Avatar answered Oct 01 '22 01:10

Dennis Williamson


If you can't find it with which (or whereis) then it could be:

  • a function defined in .bashrc or .profile (or some other file the shell loads on startup or login)
  • an alias defined in one of the above files.

You can search your environment for youtube-dl:

$ set | grep youtube-dl

or save it to some file and load it into a texteditor:

$ set >myenv
$ open -a textedit myenv

and for the aliases:

$ alias >myalias

or

$ alias | grep youtube-dl
like image 25
Nordic Mainframe Avatar answered Sep 30 '22 23:09

Nordic Mainframe


Have you tried

whereis youtube-dl

?

Otherwise you could just search for it:

find / -name youtube-dl 
like image 8
Felix Kling Avatar answered Oct 01 '22 00:10

Felix Kling