Home>Article>Operation and Maintenance> How to use which command in Linux?
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 "-n59ffcea55aee92a7bc38770bb38c7fa7", "-p59ffcea55aee92a7bc38770bb38c7fa7", "-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
-n59ffcea55aee92a7bc38770bb38c7fa7 Specifies the file name length, specified The length must be greater than or equal to the longest file name of all files.
-p59ffcea55aee92a7bc38770bb38c7fa7 Same as the -n parameter, but the 59ffcea55aee92a7bc38770bb38c7fa7 here includes the path of the file.
-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!