Linux命令的基础知识
2017-12-23 11:05
344 查看
linux分为内部命令和外部命令
内部命令shell程序为了满足用户正常使用系统而自带的命令,在系统启动时就加载进内存,并且运行时不会创建子进程
外部命令
为了满足系统上各式各样的功能而存在的可执行程序,位于文件系统的某目录下,在系统加载时不会载入内存,但是在运行时会进行缓存,可通过hash命令查看
type命令区分命令类型
内部显示格式[root@ming ~]# type cd cd is a shell builtin
外部命令显示格式
[root@ming ~]# type ls ls is aliased to `ls --color=auto'
命令执行流程
敲入命令输入回车,此处会提请shell命令解释器找到键入命令说对应的可执行程序,先在内部命令中寻找,如果找不到则调用外部命令(外部命令的搜寻路径定义在环境变量path中),都不存在则会提示命令不存在命令的帮助手册
内部命令help command
[root@ming ~]# help cd cd: cd [-L|[-P [-e]]] [dir] Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the HOME shell variable.
外部命令
man command:使用手册
command –help
info command:显示信息页
hash命令
说明:每当执行一个外部命令时,shell解释器会将搜寻到的外部命令的路径结果会缓存至kv(key-value)存储中,当第二次执行的时候直接从缓存中加载,不会再去path指定的路径下搜寻,可大大加快执行效率示例:第一列指命中次数,第二列指命令的绝对路径
[root@ming ~]# hash hits command 2 /usr/bin/date 1 /usr/bin/man 1 /usr/bin/info
常用选项
-r 清除hash表
-d 清除指定的命令
[root@ming ~]# hash -d date [root@ming ~]# hash hits command 2 /usr/bin/man 1 /usr/bin/info
相关文章推荐
- Linux基础知识及简单命令
- linux入门基础知识及简单命令介绍
- 第十四天-linux命令及基础知识实战
- Linux基础知识及常用命令
- Linux基础知识 linux命令:dnsconf
- Linux-->基础知识-->useradd命令详解
- 20_Linux基础知识及命令――――umask遮罩码
- Linux 基础命令知识3
- Linux基础知识——常用shell命令介绍(一)
- Linux命令之awk:基础知识(一)
- linux 目录结构+常用命令+压缩命令+vim使用+及一些基础知识(非常好)
- linux 系统基础知识 - vgextend命令
- Linux基础知识命令的使用格式
- Linux基础知识与命令1(su passwd)
- Linux-->基础知识-->Linux下chkconfig命令详解
- 5_Linux基础知识及命令――――ls 命令的简要说明
- Linux基础知识学习:linux用命令重启
- Linux基础知识--3.Linux目录和文件相关命令和Linux基础特性2
- 网络基础知识、linux路由管理命令(route) 、ip命令、ifconfig命令的使用、linux网卡配置
- [Linux基础]Linux基础知识入门及常见命令.