温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux常用命令type怎么用

发布时间:2022-02-17 13:59:30 来源:亿速云 阅读:123 作者:小新 栏目:开发技术

小编给大家分享一下Linux常用命令type怎么用,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

Linux常用命令type命令用来显示指定命令的类型,判断给出的指令是内部指令还是外部指令

Linux常用命令type怎么用

语法

type   (选项)  (参数)

选项

-t:输出“file”、“alias”或者“builtin”,分别表示给定的指令为“外部指令”、“命令别名”或者“内部指令”;
-p:如果给出的指令为外部指令,则显示其绝对路径;
-a:在环境变量“PATH”指定的路径中,显示给定指令的信息,包括命令别名。

参数

指令:要显示类型的指令。

实例

[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怎么用”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI