官术网_书友最值得收藏!

Determining a command's type

You can use the type command to determine the type (category) of a command. For example, if you want to know the type of the pwd command you can simply run the type pwd command:

elliot@ubuntu-linux:~$ type pwd 
pwd is a shell builtin

So now you know that the pwd command is a shell builtin command. Now let's figure out the type of the ls command:

elliot@ubuntu-linux:~$ type ls
ls is aliased to `ls --color=auto'

As you can see, the ls command is aliased to ls --color=auto. Now you know why you see a colorful output every time you run the ls command. Let's see the type of the date command:

elliot@ubuntu-linux:~$ type date 
date is /bin/date

Any command that lives in /bin or /sbin is an executable program. Therefore, we can conclude that the date command is an executable program as it resides in /bin.

Finally, let's determine the type of the type command itself:

elliot@ubuntu-linux:~$ type type 
type is a shell builtin

It turns out the type command is a shell builtin command.

主站蜘蛛池模板: 通许县| 梧州市| 酉阳| 花莲县| 淅川县| 乡城县| 永德县| 喀什市| 永年县| 昭平县| 安多县| 内江市| 马关县| 佛冈县| 丹江口市| 雷山县| 象州县| 临沂市| 西丰县| 焉耆| 敦化市| 永修县| 汝阳县| 柏乡县| 克东县| 临沧市| 益阳市| 霍林郭勒市| 天津市| 曲水县| 永定县| 扎鲁特旗| 唐海县| 乡城县| 伊宁市| 荆门市| 普安县| 中阳县| 资兴市| 苏尼特右旗| 全州县|