Linux type command – knowing what will be executed

In Linux, you can check what will run when you execute command.
The first information you need is the type of the command, if it is a built-in shell, alias, or an executable file. The type command gives that information:
type <command>
And it will tell you the command type:

In the example below, we run type against several command:


oren@oren-computer:~/workspace/sass  (master) 
$ type ls
ls is aliased to `ls --color=auto -h'
oren@oren-computer:~/workspace/sass  (master) 
$ type test
test is a shell builtin
oren@oren-computer:~/workspace/sass  (master) 
$ type cp
cp is /bin/cp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s