✍️ Linux/Unix: Editors & Help Tools
Estimated reading: 3 minutes 265 views

Linux/Unix: Command Lookup Tools – type, which, whatis, apropos Explained

Introduction – Why Learn Linux Command Lookup Tools?

Linux offers multiple tools to identify commands, their locations, usage, and related utilities. Whether you’re a beginner checking where a command resides or a pro searching for forgotten commands, tools like type, which, whatis, and apropos make command-line navigation faster and smarter.

In this guide, you’ll learn:

  • How to find the type or path of a command
  • How to get a one-line summary of any command
  • How to discover related commands by keyword
  • Real-world use cases with output examples

1. type – Identify the Nature of a Command

What is type?

type tells you how a command is interpreted by the shellβ€”whether it’s a built-in, alias, function, or executable.

Syntax:

type command

Examples:

type ls

Output:

ls is aliased to `ls --color=auto`
type cd

Output:

cd is a shell builtin

Great for debugging behavior when commands act differently than expected.


2. which – Locate Executable Path

What is which?

which shows the full path to an executable command in the user’s $PATH.

Syntax:

which command

Examples:

which python3

Output:

/usr/bin/python3
which ifconfig

Output (if installed):

/sbin/ifconfig

Ideal for checking if a command is installed and which version is being used.


3. whatis – Get One-Line Description of a Command

What is whatis?

whatis fetches a brief one-line summary from the manual database.

If database is missing, update it:

sudo mandb

Syntax:

whatis command

Example:

whatis grep

Output:

grep (1)             - print lines that match patterns

Perfect for quick lookups when you forget what a command does.


4. apropos – Search for Commands by Keyword

What is apropos?

apropos searches manual page descriptions for any given keyword. It’s like man -k.


Syntax:

apropos keyword

Examples:

apropos network

Sample Output:

netstat (8) - Print network connections, routing tables...
ifconfig (8) - configure a network interface
ping (8) - send ICMP ECHO_REQUEST to network hosts

Great for discovering new tools or when you don’t remember the exact command name.


Tool Comparison Table

CommandPurposeOutput TypeIdeal For
typeShow if command is built-in, alias, etcText explanationShell behavior debugging
whichLocate command binary pathFile pathFinding executable location
whatisShow one-line manual summaryDescriptionQuick info lookup
aproposSearch man pages by keywordList of matchesDiscovering related commands

Summary – Recap & Next Steps

Command lookup tools help you understand, locate, and learn Linux commands efficiently. From checking command types to exploring related tools, these are your best friends when navigating the terminal.

Key Takeaways:

  • Use type to see if a command is built-in, alias, or external.
  • Use which to locate the path of executables.
  • Use whatis to get short command summaries.
  • Use apropos to explore related commands by topic.

FAQs

Why does which not show aliases?
which only checks for executable files, not aliases or shell built-ins. Use type instead for full classification.

Can I search for man pages that match a keyword?
Yes, use apropos keyword or man -k keyword.

What if whatis and apropos return nothing?
Your manual database may be outdated. Update it with:

sudo mandb

Is there a way to list all aliases?
Yes:

alias

How can I see the path of a shell built-in like cd?
You can’tβ€”it has no path. Use:

type cd

Share Now :
Share

πŸ”΅ Linux/Unix: Command Lookup (type, which, whatis, apropos)

Or Copy Link

CONTENTS
Scroll to Top