The function of which command in Linux is to search for the location of a certain system command in the path specified by the PATH variable and return the first search result. Its usage is "which [file...]" , its parameters include "-n
", "-p ", "-w" and "-V".
Linux which command is used to find files.
which command will search for files that meet the conditions in the directory set by the environment variable $PATH.
which Syntax
which [文件...]
which Parameter
-n
-p
-w Specifies the width of the field during output.
-V Display version information.
which Example
Use the command "which" to view the absolute path of the command "bash", enter the following command:
$ which bash
After executing the above command , the output information is as follows:
/bin/bash #bash可执行程序的绝对路径
Recommended tutorial: "Linux Operation and Maintenance"
The above is the detailed content of How to use which command in Linux?. For more information, please follow other related articles on the PHP Chinese website!