English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux which command

Linux Command大全

Linux which command is used to find files.

The which command will search for files in the directories set by the environment variable $PATH.

Syntax

which [file...]

Parameters:

  • -n<file name length>  Specify the file name length, the specified length must be greater than or equal to the longest file name among all files.
  • -p<file name length>  is similar to-n parameter is the same, but the <file name length> here includes the file path.
  • -w  Specify the width of the output columns.
  • -V  Display version information.

Online Examples

Use the command "which" to view the absolute path of the command "bash", input as follows:

$ which bash

After executing the above command, the output information is as follows:

/bin/bash                   #Absolute path of the bash executable program 

Linux Command大全