Linux Command Search command Whereis and which
In linux command Search command, may listen to a bit around the mouth, is the command of the search command.
First of all, Whereis, let's take a look at Whereis's manual.
Man Whereis man means the manual manual. The man command is to see how a command works and how to use it.
Mans Whereis
whereis-locate the Binary,source,and manual page files for a command
Locate the binary file for a command, the source file, and the Help manual.
Whereis [Options] Command
The options can include the following
-B Search for binaries. Search for executable files
-M search for manual. Search Manuals
-S search for source files
These three are common options, enough on the line.
If none of the options are added, it is the location of the search command and the Help manual for the command.
Example: Whereis ls
Output result ls:/bin/ls/usr/share/man/man1/ls.1.gz
Example: Whereis-b ls
Output result Ls:/bin/ls
Just check where the command is.
In the following: Whereis-m ls
Output result ls:/usr/share/man/man1/ls.1.gz
View the manual location of the command.
The which command is also a command to search for commands.
How it's used which command
Only the which command displays the location of the command and the alias of the command.
PS: Talk about the alias of the command. Execute the alias command in Linux.
Alias is the meaning of aliases.
will have the following output results
Alias egrep= ' Egrep--color=auto '
Alias fgrep= ' Fgrep--color=auto '
Alias grep= ' grep--color=auto '
Alias l= ' LS-CF '
Alias La= ' Ls-a '
Alias Ll= ' Ls-alf '
Alias ls= ' ls--color=auto '
Format is alias command= ' comand [options] '
Is that you execute the LS command in terminal, which is equivalent to executing the LS--color=auto command. The alias of the command can be modified on its own.
Format is alias command= ' comand [options] '
--color=auto make the result color of the command output adaptive (that is, the system default color)
Linux Command Search command Whereis and which