The Wayback Machine - https://web.archive.org/web/20230524101342/https://www.geeksforgeeks.org/which-command-in-linux-with-examples/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

which command in Linux with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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.

My Personal Notes arrow_drop_up
Last Updated : 27 May, 2019
Like Article
Save Article
Similar Reads