whatis, which & whereis

 

We can use whatis to get the same results we would get with man -f:

# whatis passwd
passwd (1)       -­ update user’s authentication tokens
sslpasswd (1ssl) -­ compute password hashes
passwd (5)       -­ password file

The command which shows us the full path of the given command:

# which passwd      →  show just the first match
/bin/passwd
.
# which -­a passwd   →  show all the matches
/bin/passwd
/usr/bin/passwd

We can achieve the same result with the whereis command:

# whereis passwd          → shows matches for binaries, manpages & source files
passwd: /usr/bin/passwd /etc/passwd /usr/share/man/man1/passwd.1.gz /usr/share/man/man5/passwd.5.gz
.
# whereis ­-b passwd       → shows matches only for binaries
passwd: /usr/bin/passwd /etc/passwd
.
# whereis ­-ms passwd      → shows matches only for manpages & source files
passwd: /usr/share/man/man1/passwd.1.gz /usr/share/man/man5/passwd.5.gz

<< apropos                           fc & history >>