Forrest logo
back to the type tool

type:tldr:12747

type: Display the name of the disk file that would be executed.
$ type -p ${command}
try on your machine

The type -p command is used to display the path of the specified command. Here's how it works:

  1. ${command} is a placeholder that represents the command name you want to check.
  2. The type -p command is then used to find the path of the command.
  3. When you run type -p ${command}, it will search for the specified command in the directories listed in the PATH environment variable.
  4. If the command is found, it will display the complete path to the command.
  5. If the command is not found, it will display nothing.

For example, if you run type -p ls, it will display the path of the ls command, which is typically /bin/ls.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the type tool