Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get full path name of a Linux command

Tags:

linux

shell

I want to find out the file path of commands in Linux e.g., ls has file path as /bin/ls. How can I find out the exact path of some commands?

like image 957
Dipak Avatar asked Sep 14 '25 18:09

Dipak


1 Answers

As pointed out, which <progName> would do it. You could also try:

whereis -b <progName>

This will list all the paths that contains progName. I.e whereis -b gcc on my machine returns:

gcc: /usr/bin/gcc /usr/lib/gcc /usr/bin/X11/gcc
like image 72
user3813674 Avatar answered Sep 16 '25 08:09

user3813674