Friday, December 23, 2011

Linux - whereis / type

It's incredible that up to this day I lived without knowing about these commands.

You can use "type" or "whereis" command to find out which command shell executes and to print binary (command) file location for specified command.

http://www.cyberciti.biz/tips/find-linux-unix-command-location.html

For instance:

postgres@linux-2561:~> whereis repmgr
repmgr: /usr/bin/repmgr /usr/bin/X11/repmgr
postgres@linux-2561:~> type -a repmgr
repmgr is /usr/bin/repmgr
repmgr is /usr/bin/X11/repmgr

Update: the 'which' utility seems to accomplish the same.
http://linux.about.com/library/cmd/blcmdl1_which.htm

No comments:

Post a Comment