- 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.
推薦閱讀
- Unity 2020 By Example
- JSP網(wǎng)絡(luò)編程(學(xué)習(xí)筆記)
- Swift 3 New Features
- 用Python實(shí)現(xiàn)深度學(xué)習(xí)框架
- 51單片機(jī)C語(yǔ)言開發(fā)教程
- JavaScript應(yīng)用開發(fā)實(shí)踐指南
- Android應(yīng)用開發(fā)實(shí)戰(zhàn)(第2版)
- Clojure High Performance Programming(Second Edition)
- Test-Driven iOS Development with Swift
- Access 2016數(shù)據(jù)庫(kù)應(yīng)用與開發(fā):實(shí)戰(zhàn)從入門到精通(視頻教學(xué)版)
- 精通Oracle 12c 數(shù)據(jù)庫(kù)管理
- 嵌入式網(wǎng)絡(luò)編程
- Python for Secret Agents
- Learning Puppet Security
- Balsamiq Wireframes Quickstart Guide