Master Linux ‘type’ Command: Identify Types, Locations, and Paths
This guide explains how to use the Linux type command to discover whether a command is built‑in, external, or an alias, and shows how to display its location and full filesystem path with practical examples.
In Linux systems, understanding a command's type, location, and full path is essential for system administration and development. The type command is a powerful tool that reveals this information for any given command.
Part 1: Basic Usage and Options
The basic syntax is: type [options] command Common options: -a: show all locations associated with the command. -t: show only the command type. -P: display the command's full path.
Part 2: Viewing Command Type and Location
Built‑in commands (embedded in the shell). type cd Example output: cd is a shell builtin External commands (stand‑alone executables). type ls Example output: ls is /bin/ls Command aliases (user‑defined shortcuts). type ll Example output:
ll is aliased to 'ls -alF'Part 3: Finding the Full Path of a Command
Full path of an external command: type -P ls Output: /bin/ls Full path of the actual command behind an alias: type -P ll Output:
/bin/lsPart 4: Displaying All Related Locations
Using the -a option shows every location where the command is found. type -a python Example output:
python is /usr/bin/python
python is /usr/local/bin/pythonConclusion
This article explored the type command in depth, demonstrating how to determine a command's type (built‑in, external, or alias), locate it, and retrieve its full filesystem path, helping readers improve efficiency and accuracy in system management and development.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
