- 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.
推薦閱讀
- 演進式架構(原書第2版)
- arc42 by Example
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- Learning Flask Framework
- Java FX應用開發教程
- Mastering Python High Performance
- CouchDB and PHP Web Development Beginner’s Guide
- SAS數據統計分析與編程實踐
- 你不知道的JavaScript(中卷)
- 軟件項目管理實用教程
- Highcharts Cookbook
- Natural Language Processing with Python Quick Start Guide
- 從“1”開始3D編程
- Software Architecture with Python
- 生成藝術:Processing視覺創意入門