Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux which command

Linux which command

Linux Command Reference Linux Command Reference

The Linux which command is used to locate files.

The which command searches directories set in the $PATH environment variable for files that meet the criteria.

Syntax

which [文件...]

Parameters:

Example

To use the "which" command to view the absolute path of the "bash" command, enter the following command:



$ which bash

After running the above command, the output is as follows:



/bin/bash                   #bash可执行程序的绝对路径 

Linux Command Reference Linux Command Reference