Linux which command
Linux which command is used to locate the file.
instruction which will locate the matching files in the environment variable $ PATH directory set in.
grammar
which [文件...]
Parameters:
- -n <file name length> Specify the file name length, the length specified must be greater than or equal to the longest of all the files in the file name.
- -p <file name length> and -n parameters the same, but where <filename length> including the path to the file.
- -w Specifies the width of the output field.
- -V Display version information.
Examples
Using the command "which" view instruction "bash" absolute path, enter the following command:
$ which bash
After the above instruction is executed, the output information is as follows:
/bin/bash #bash可执行程序的绝对路径