How do I find the path to a command file?
You can use command which (use to locate a command). which returns the pathnames of the files which would be executed in the current environment, had its arguments been given as commands in a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments.
Syntax:
which {command-name}
Examples:
$ which ls
/bin/ls
$ which gcc
/usr/bin/gcc
See also:
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- UNIX / Linux: Set your PATH Variable using set or export command
- Solaris find out a package which a file belongs to
- Linux / UNIX: Command not found error and how do I get rid of it?
- How to Set JAVA_HOME / PATH variables Under Linux Bash Profile
- Display or print UNIX / Linux path ~ $PATH variable
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!



Recent Comments
Today ~ 10 Comments
Today ~ 9 Comments
Today ~ 6 Comments
Yesterday ~ 6 Comments
Yesterday ~ 68 Comments