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:
${command}
is a placeholder that represents the command name you want to check.- The
type -p
command is then used to find the path of the command. - When you run
type -p ${command}
, it will search for the specified command in the directories listed in thePATH
environment variable. - If the command is found, it will display the complete path to the command.
- 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.