OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

type – Display A Command's Type

The type command is a shell builtin that displays the kind of command the shell will execute, given a particular command name. It works like this:



type command

type command


where “command” is the name of the command you want to examine. Here are some ex- amples:



[me@linuxbox ~]$ type type type is a shell builtin [me@linuxbox ~]$ type ls

ls is aliased to `ls --color=tty' [me@linuxbox ~]$ type cp

cp is /bin/cp

[me@linuxbox ~]$ type type type is a shell builtin [me@linuxbox ~]$ type ls

ls is aliased to `ls --color=tty' [me@linuxbox ~]$ type cp

cp is /bin/cp


Here we see the results for three different commands. Notice that the one for ls (taken from a Fedora system) and how the ls command is actually an alias for the ls command with the “-- color=tty” option added. Now we know why the output from ls is displayed in color!


Top OS Cloud Computing at OnWorks: