Linux Learning-which command
Which is where path is specified, searches for the location of a system command, and returns the first search result. By using the which command, you can see whether a system command exists, and which location is executing the command.
Common parameters and their functions:
-N: Specifies that the file name length specified must be greater than or equal to the longest file name in all files.
-P: The same as the-n parameter but the path of the file is included here.
-A: The instructions in the path directory can be found more than the first one.
-W: Specifies the width of the field when output.
-V: Display version information
High frequency operation:
Find a common command path
[Atong@liwentong tmp]$ which PWD
/bin/pwd
Specific alias information is listed when you look for an alias command
[Atong@liwentong tmp]$ which LS
Alias ls= ' ls--color=tty '
/bin/ls
The lookup command is not in the normal user's path such as the Ifconfig command
[Atong@liwentong tmp]$ which ifconfig
/usr/bin/which:no ifconfig in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/atong/bin)
Bash built-in command cannot be traced as CD command
[Atong@liwentong tmp]$ which CD
/usr/bin/which:no CD in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin: