which command in Linux with examples
which command in Linux is a command which is used to locate the executable file associated with the given command by searching it in the path environment variable. It has 3 return status as follows:
- 0 : If all specified commands are found and executable.
- 1 : If one or more specified commands is nonexistent or not executable.
- 2 : If an invalid option is specified.
Syntax:
which [filename1] [filename2] ...

Options:
- which -a : This option print all matching pathnames of each argument.

- info which : It displays help information.
Recommended Posts:
- du command in Linux with examples
- df command in Linux with Examples
- ZIP command in Linux with examples
- pwd command in Linux with Examples
- apt-get command in Linux with Examples
- wc command in Linux with examples
- cc command in Linux with Examples
- rev command in Linux with Examples
- fmt command in Linux with examples
- cd command in Linux with Examples
- Cat command in Linux with examples
- atd command in Linux with examples
- col command in Linux with Examples
- atq command in linux with examples
- w command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



