You can use "type" or "whereis" command to find out which command shell executes and to print binary (command) file location for specified command.
whereis command example
Display ls command location along with man page path:
whereis ls
Output:
ls: /bin/ls /usr/share/man/man1p/ls.1p.gz /usr/share/man/man1/ls.1.gz
type command example
Find out which command the shell executes:
type -a ls
Output:
ls is aliased to `ls --color=tty'
ls is /bin/ls
Related: How Linux or UNIX Understand which program to run - PART I and How BASH Shell Command Search Sequence Works
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop





![Sending Email With Attachments From Unix / Linux Command [ Shell Prompt ]](http://s13.cyberciti.org/images/shared/rp/3/10.jpg)








{ 4 comments… read them below or add one }
If for some reason the command you are looking for is not in your PATH you can try the locate command to find out where it might be located
% locate ls
i access my server through sshd using putty but after a certain period of time the port on which sshd is open is closed automatically.
i am not able to figure out this problem.
please help me thanks in advance
How to know the virsion of a binary file in UNIX?
Need unix command for the same.
Typically programs have a version command line option to print the version number. Try running ‘program -v’ or ‘program –version’. Some binary files on your system are actually a link to a specific version of that program. For example, on my system, /usr/bin/python is a link to python-2.7, so I know that I have python version 2.7. (to see if a file is a link run ‘ls -l /path/to/file’ and it will have a ‘l’ at the beginging of the line, and have an arrow at the end followed by the file that the link points to).