What does 'type' command do?

0167

The type command in Linux is used to determine how a command is interpreted by the shell. It provides information about the command's type, such as whether it is a built-in shell command, an alias, a function, or an external executable.

Here’s a breakdown of what type can tell you:

  • Built-in: Indicates that the command is a built-in shell command.
  • Alias: Indicates that the command is an alias defined in the shell.
  • Function: Indicates that the command is a shell function.
  • File: Indicates that the command is an external executable file, along with its path.

You can use it like this:

type <command_name>

For example:

type echo

This might output:

echo is a shell builtin

This tells you that echo is a built-in command in the shell.

0 Comments

no data
Be the first to share your comment!