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.

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.

No comments:

Post a Comment