- 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.
推薦閱讀
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- 從零開始:數字圖像處理的編程基礎與應用
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Unity Virtual Reality Projects
- Visual Basic程序設計實驗指導(第4版)
- Learning Apache Mahout Classification
- 名師講壇:Spring實戰開發(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- 批調度與網絡問題的組合算法
- Android驅動開發權威指南
- Java EE架構設計與開發實踐
- C語言程序設計教程
- Python趣味創意編程
- Dart:Scalable Application Development
- Spring Web Services 2 Cookbook
- React.js實戰