Untitled Document
type Command

type command is used to find out if command is builtin or external binary file. It also indicate how it would be interpreted if used as a command name. Basically type command does two task first it will print whether the command is shell built in ( internal or external command ) and second is it shows the executable path ( location where command is stored ) from where the command is read during execution .

1. Basic Example -

The following command Displays the path of ls command.The easiest way of knowing the loaction of an executable program .

   $ type ls                    
   ls is /bin/ls

when we execute ls command , the shell locates this file in the /bin directory and make an arrangement to execute it . type looks up only the directories specified in the PATH variable .

2. Know your command type -

The following command Displays whether the command is internal or external command, echo is an external command

   $ type echo                     
   echo is a shell builtin 
Untitled Document