GNU/Linux Command – WHICH

which — Shows the location of (shell) commands.

Summary:

which will search for the given command in the PATH and prints the full path of the executables that would have been executed when this command had been entered at the shell prompt.

Examples:
$ which ls -- Print the 1st matching location and alias. $ which -a kill -- Print all matchings. $ which --skip-alias ls -- Don't print the ls alias. $ which --skip-dot gcc -- Skip Dirs in PATH that start with a dot. $ which --skip-tilde test -- Skip Dirs in PATH that start with atilde and executables which reside in the HOME directory. $ which ls rm cp -- Search for multiple commands. $ which NoCmd -- Just Try..
Read: man which

Advertisements
Tagged with: ,
Posted in Uncategorized

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

%d bloggers like this: