Linux: find the location of the executables

  • How to locate the binary, source and/or man page files for a command?
    $ whereis command

‘whereis’ has some options you can specify in order to limit the places to look at, or the type of files (binary, source, man page file, …etc).

The ‘whereis’ command returns all the places where the command can be found, looking into typical Unix locations. But, more frequently, you are just interested in finding where the commands you type on the command line are located on the filesystem, according to the $PATH variable.

  • How to show the path of a command?
    $ which command

Without parameter, it stops on the first command found in the path. If you want to list all the locations of the command in the path, you can call it with the -a option.

I encourage you to browse the man pages if you want a detailed description of these commands.

About these ads

About nidget

Technology enthousiast, Java and JEE expert, IT architect.
This entry was posted in Tips and tricks and tagged , , , , , . Bookmark the permalink.

One Response to Linux: find the location of the executables

  1. Pingback: Linux: find the location of the executables | @HuyNT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s