O'Reilly logo

The Linux Command Line by William E. Shotts Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Identifying Commands

It is often useful to know exactly which of the four kinds of commands is being used, and Linux provides a couple of ways to find out.

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

where command is the name of the command you want to examine. Here are some examples:

[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 ls command (taken from a Fedora system) is actually an alias for the ls command with the --color=tty option ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required