对于Linux系统,用户们一定对它那功能强大的命令印象深刻,不过有许多Linux用户对Linux系统中的各项命令并不太熟悉,下面就和小编一起来看看Linux系统的命令吧。
Linux的命令分为内部命令和外部命令:
内部命令在系统启动时就调入内存,是常驻内存的,所以执行效率高。
外部命令是系统的软件功能,用户需要时才从硬盘中读入内存。
type可以用来判断一个命令是否为内置命令
type: usage: type [-afptP] name [name 。。。]
[root@linuxeye ~]# type type
type is a shell builtin
[root@linuxeye ~]# type -p type
[root@linuxeye ~]# type -t type
builtin
[root@linuxeye ~]# type type
type is a shell builtin
[root@linuxeye ~]# type -t type
builtin
[root@linuxeye ~]# type pwd
pwd is a shell builtin
[root@linuxeye ~]# type whiptail
whiptail is /usr/bin/whiptail
[root@linuxeye ~]# type -t whiptail
file
enable既可以查看内部命令,同时也可以判断是否为内部命令
[root@linuxeye ~]# enable -a #查看内部命令
[root@linuxeye ~]# enable whiptail #非内部命令
-bash: enable: whiptail: not a shell builtin
[root@linuxeye ~]# enable pwd #是内部命令
内部命令用户输入时系统调用的速率快,不是内置命令,系统将会读取环境变量文件.bash_profile、/etc/profile去找PATH路径。
然后在提一下命令的调用,有些历史命令使用过后,会存在在hash表中,当你再次输入该命令它的调用会是这样一个过程。
hash——》内置命令——》PATH 命令的调用其实应该是这样一个过程。
[root@linuxeye ~]# type pwd
pwd is a shell builtin
[root@linuxeye ~]# type cat
cat is /usr/bin/cat
[root@linuxeye ~]# ls linuxeye*
linuxeye.pem linuxeye.txt
[root@linuxeye ~]# cat linuxeye.txt
linuxeye
[root@linuxeye ~]# hash -l #显示hash表
builtin hash -p /usr/bin/cat cat
builtin hash -p /usr/bin/ls ls
[root@linuxeye ~]# type cat
cat is hashed (/usr/bin/cat)
[root@linuxeye ~]# hash -r #清除hash表
[root@linuxeye ~]# type cat
cat is /usr/bin/cat
从上面操作可以看出。hash表不存放系统内置命令。
这就是Linux系统中的内部命令和外部命令了,对Linux命令不熟悉,或者感兴趣的用户快来看看吧。
Linux,命令
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 海信AI电视E7N正式发布,引领AI画质新标杆
- 屠洪刚.2002-九九艳阳天【京文】【WAV+CUE】
- 齐秦.1996-丝路【东方】【WAV+CUE】
- 泳儿.2010-VINSELECTION新曲+精选2CD【英皇娱乐】【WAV+CUE】
- 【原神】希诺宁抽取建议,0命完全体!主要聊一下2命!
- 【原神】V5.0攻略 | 纳西妲培养攻略
- 【原神】V5.0攻略 | 材料(星螺)路线图
- 张尕怂(2020)《土潮》FLAC
- 姚璎格《听·姚璎格》HQCD[DTS-WAV]
- 李翊君2012-爱上寂寞[华特音乐][WAV+CUE]
- 洛克王国世界宠物图鉴 2024最新精灵汇总
- 三角洲行动武器推荐 武器强度排行
- 归龙潮言预龙咒怎么搭配 最佳搭配推荐
- 炉石传说最强牧师卡组是哪个 牧师最强天梯卡组推荐一览
- s14全球总决赛瑞士轮赛程表有没有 s14世界赛瑞士轮赛程表一览