Linux commands (9)---whereis, whatis, which commands

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.