网站开发技术

记点笔记、 学点技术 欢迎交流建站技术。本站关注lamp技术

您尚未登录。

#1 2014-12-24 12:08:45

admin
管理员

shell 中 GLOBIGNORE 用法示例

[root@ippbs ~]# rm * -f
[root@ippbs ~]# touch a1.txt a2.txt a3.txt
[root@ippbs ~]# touch b1.txt b2.txt b3.txt
[root@ippbs ~]#
[root@ippbs ~]# GLOBIGNORE='a*'
[root@ippbs ~]# ls a*
ls: cannot access a*: No such file or directory
[root@ippbs ~]# GLOBIGNORE='a*:b*'
[root@ippbs ~]# ls
a1.txt  a2.txt  a3.txt  b1.txt  b2.txt  b3.txt
[root@ippbs ~]# ls *
ls: cannot access *: No such file or directory

这首先清空目录后,创建六个文件。

GLOBIGNORE="a*" 作用是当执行 ls a* , 的是, 这里命令中有 * 。 才有效果

如果没有 * GLOBIGNORE 没有效果。

需要注意的地方是使用多个,他们之间用冒号分开。


ipbbs.net

离线

页脚

Powered by FluxBB