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

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.

主站蜘蛛池模板: 黔江区| 竹北市| 松原市| 望江县| 通辽市| 长顺县| 灵石县| 榆社县| 鹤庆县| 罗源县| 曲周县| 岑溪市| 稷山县| 阜宁县| 浪卡子县| 肥西县| 曲松县| 富阳市| 麻栗坡县| 保靖县| 济宁市| 什邡市| 河津市| 呼伦贝尔市| 彩票| 淳安县| 赤峰市| 齐河县| 江门市| 凭祥市| 大英县| 吉隆县| 都匀市| 镇坪县| 天峨县| 威宁| 阿巴嘎旗| 东乌珠穆沁旗| 乌海市| 宜兰县| 随州市|