whereis Command: Locate the binary, source, and manual page files for a command
"Features" Find relevant locations for files, manual pages, commands, etc.,
Syntax
Whereis Options argument
"Common Options"
-B: Find only the binary file location-m: Find only the man pages section
"Instance 1" finds the location of the binary file
[Email protected] tmp]# whereis-b passwdpasswd:/usr/bin/passwd/etc/passwd[[email protected] tmp]# whereis-b Shadowsha Dow:/etc/shadow/usr/include/shadow.h
"Instance 2" Find manual manual page
[Email protected] tmp]# whereis-m passwdpasswd:/usr/share/man/man1/passwd.1.gz/usr/share/man/man5/passwd.5.gz[[ Email protected] tmp]# whereis-m CDCD:/usr/share/man/man1/cd.1.gz/usr/share/man/man1p/cd.1p.gz[[email protected] tmp ]# whereis-m Sortsort:/usr/share/man/man1/sort.1.gz/usr/share/man/man3/sort.3pm.gz/usr/share/man/man1p/ Sort.1p.gz
whatis Command: Search the Whatis database for complete words
"Features" search for specific commands in the Whatis library
Syntax
Whatis COMMAND
Instance
[[email protected] tmp]# whatis passwdpasswd (1) - update user ' s authentication tokenspasswd (5 ) - password filepasswd [sslpasswd] (1SSL) - compute password hashes[[email protected] tmp]# whatis sortsort (1p) - sort, merge, or sequence check text filessort (1) - sort lines of text filessort (3pm) - perl pragma to control sort () behaviour
which command: shows the full path of (shell) commands
Features view the path of the executable command
Syntax
Which COMMAND
Instance
[email protected] tmp]# which lsalias ls= ' ls--color=auto '/bin/ls[[email protected] tmp]# which PASSWD/USR/BIN/PA Sswd[[email protected] tmp]# which Cd/usr/bin/which:no CD in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/ Sbin:/bin:/usr/sbin:/usr/bin:/root/bin) [[email protected] tmp]# which sort/bin/sort[[email protected] tmp]# which Shutdown/sbin/shutdown
This article is from the "Perthon" blog, make sure to keep this source http://perthon.blog.51cto.com/10484057/1766405
Linux commands (9)---whereis, whatis, which commands