Linux命令(127)之hash

简介: Linux命令(127)之hash

linux命令之hash

1.hash介绍
linux命令hash是把搜寻到的外部命令的路径结果会缓存至内存缓存中

2.hash用法
hash [参数] command

hash参数
参数 说明
-d 删除指定某个命令
-r 清空所有命令
-l 列出内存缓存中的命令
3.实例
3.1.列出内存缓存中的命令
命令:

hash -l

[root@rhel77 ~]# hash -l
builtin hash -p /usr/bin/mv mv
builtin hash -p /usr/bin/cp cp
builtin hash -p /usr/bin/man man
builtin hash -p /usr/bin/scp scp
[root@rhel77 ~]#
3.2.删除指定某个命令
命令:

hash -d scp

[root@rhel77 ~]# hash -d scp
[root@rhel77 ~]# hash -l
builtin hash -p /usr/bin/mv mv
builtin hash -p /usr/bin/cp cp
builtin hash -p /usr/bin/man man
[root@rhel77 ~]#
3.3.清空所有命令
命令:

hash -r

[root@rhel77 ~]# hash -r
[root@rhel77 ~]# hash -l
hash: hash table empty
[root@rhel77 ~]#
————————————————
版权声明:本文为CSDN博主「小黑要上天」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/z19861216/article/details/134455076

目录
相关文章
|
3天前
|
Linux
Linux的cp命令如何使用?
Linux的cp命令如何使用?
11 5
|
7天前
|
Linux
Linux常用命令包括
Linux常用命令包括
16 5
|
7天前
|
Linux
Linux命令
Linux命令
18 5
|
3天前
|
安全 Linux Shell
常见的 Linux 命令大全(表格形式)
常见的 Linux 命令大全(表格形式)
|
11天前
|
Linux Python Perl
Linux命令删除文件里的字符串
Linux命令删除文件里的字符串
26 7
|
11天前
|
Shell Linux
Linux shell编程学习笔记82:w命令——一览无余
Linux shell编程学习笔记82:w命令——一览无余
|
13天前
|
Linux Perl
Linux之sed命令
Linux之sed命令
|
13天前
|
Linux
深入理解Linux中的cp命令:文件与目录的复制利器
深入理解Linux中的cp命令:文件与目录的复制利器
|
13天前
|
Linux Docker 容器
9. 同步执行Linux多条命令
9. 同步执行Linux多条命令
|
1天前
|
Linux