溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux常用命令type怎么用

發(fā)布時間:2022-02-17 13:59:30 來源:億速云 閱讀:138 作者:小新 欄目:開發(fā)技術(shù)

小編給大家分享一下Linux常用命令type怎么用,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

Linux常用命令type命令用來顯示指定命令的類型,判斷給出的指令是內(nèi)部指令還是外部指令

Linux常用命令type怎么用

語法

type   (選項(xiàng))  (參數(shù))

選項(xiàng)

-t:輸出“file”、“alias”或者“builtin”,分別表示給定的指令為“外部指令”、“命令別名”或者“內(nèi)部指令”;
-p:如果給出的指令為外部指令,則顯示其絕對路徑;
-a:在環(huán)境變量“PATH”指定的路徑中,顯示給定指令的信息,包括命令別名。

參數(shù)

指令:要顯示類型的指令。

實(shí)例

[root@localhost ~]# type lsls is aliased to `ls --color=tty'

[root@localhost ~]# type cd
cd is a shell builtin

[root@localhost ~]# type date
date is /bin/date

[root@localhost ~]# type mysql
mysql is /usr/bin/mysql

[root@localhost ~]# type nginx
-bash: type: nginx: not found

[root@localhost ~]# type if
if is a shell keyword

[root@localhost ~]# type which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'[root@localhost ~]# type -a cdcd is a shell builtin[root@localhost ~]# type -a grepgrep is /bin/grep


看完了這篇文章,相信你對“Linux常用命令type怎么用”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI