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

  • Learn Linux Quickly
  • Ahmed AlKabary
  • 179字
  • 2021-06-11 18:43:50

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.

主站蜘蛛池模板: 兴和县| 盐亭县| 民乐县| 丹东市| 陆川县| 茌平县| 三江| 竹溪县| 阿荣旗| 永定县| 微博| 连平县| 鄂托克前旗| 建始县| 泾阳县| 辛集市| 婺源县| 徐闻县| 南川市| 酒泉市| 青海省| 南皮县| 敦化市| 溧水县| 连江县| 广丰县| 鱼台县| 龙岩市| 云安县| 青川县| 桂东县| 靖宇县| 内丘县| 平凉市| 纳雍县| 佛山市| 衡阳市| 虎林市| 松桃| 福州市| 富平县|