linux學習筆記-type命令

來源:互聯網
上載者:User

標籤:linux   type命令   

文法:

type [-tpa] name

參數:

type:    不加任何參數時,type會顯示出name是外部命令還是內部bash內建命令

-t:      當加入-t參數時,type會將name以下面這些字眼顯示出它的意義

           file:表示為外部命令

           alias:表示該命令為命令別名所設定的名稱

           builtin:表示該命令為bash內建的命令功能

-p:     如果後面接的name為外部命令時,才顯示完整檔案名稱

-a:     會有path變數定義的路徑中,將所有含有name的命令都列出來,包含alias



範例:查詢ls這個命令是否為bash內建

[[email protected] ~]# type ls

ls is aliased to `ls --color=auto‘

[[email protected] ~]# type -t ls

alias

[[email protected] ~]# type -a ls

ls is aliased to `ls --color=auto‘

ls is /bin/ls


範例二:查詢cd

[[email protected] ~]# type cd

cd is a shell builtin

[[email protected] ~]# type -t cd

builtin

[[email protected] ~]# type -a cd

cd is a shell builtin






   

本文出自 “完美式_開始” 部落格,請務必保留此出處http://7184803.blog.51cto.com/7174803/1413377

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.