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

  • 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.

主站蜘蛛池模板: 财经| 体育| 重庆市| 玛纳斯县| 平塘县| 通道| 桓台县| 玛纳斯县| 青河县| 博爱县| 乌鲁木齐县| 南部县| 肥西县| 陆河县| 澳门| 田林县| 古交市| 巴楚县| 阿克苏市| 岗巴县| 阿拉善右旗| 宜州市| 仁布县| 修文县| 北辰区| 治县。| 阳新县| 丁青县| 突泉县| 大同县| 玛纳斯县| 丰都县| 方城县| 克山县| 宣化县| 盐池县| 三穗县| 义马市| 阿瓦提县| 尉氏县| 出国|