Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

type command in Linux with Examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The type command is used to describe how its argument would be translated if used as commands. It is also used to find out whether it is built-in or external binary file.

Syntax:

type [Options] command names

Example:

Options:

  • -a : This option is used to find out whether it is an alias, keyword or a function and it also displays the path of an executable, if available.

    Example:

    type -a pwd

  • -t : This option will display a single word as an output.
    • alias – if command is a shell alias
    • keyword – if command is a shell reserved word
    • builtin – if command is a shell builtin
    • function – if command is a shell function
    • file – if command is a disk file

    Example:

    type -t pwd
    type -t cp
    type -t ls
    type -t while
    

  • -p : This option displays the name of the disk file which would be executed by the shell. It will return nothing if the command is not a disk file.

    Example:

    type -p dash

My Personal Notes arrow_drop_up
Last Updated : 06 May, 2019
Like Article
Save Article
Similar Reads