Linux 指令与文件的搜寻 —— which whereis locate updatedb find
来源:互联网 发布:自己拍电影知乎 编辑:程序博客网 时间:2024/05/22 01:38
一,指令的搜索
which(小而精)
(a)它只从 PATH 环境变量指定的路径中去搜索命令(b)通常使用 which 来确定是否安装了某个指定的软件(c)which命令选项 | -a | 将所有由PATH目录中可以找到的指令均列出
二,文件档名的搜索
1、whereis(简单快速)
(a)直接从数据库中查询(b)whereis命令选项 | -l | 列出 whereis 会去查询的几个主要目录 | -b | 只查找二进制格式的文件 | -m | 只查找man帮助文件 | -s | 只找source源代码文件 | -u | 搜寻不在 bms 项目当中的其他特殊文件
2、locate/updatedb(快而全)
(a)locate 利用数据库来搜索文件名默认搜索二进制文件(-b),man 帮助文件(-m)和源代码文件(-s)(b) updatedb 搜寻系统硬盘内的文件名,并更新数据库文件。 由于搜索时间较长,通常使用updatedb&,让该指令在后台执行。 系统使用定时任务每天自动执行 updatedb 命令更新一次。(c)locate/updatedb命令选项 | -i | 忽略大小写的差异 | | -c | 不输出档名,仅计算找到的文件数量 | | -l | 设置输出的行数 | | -S | 输出 locate 所使用的数据库文件的相关信息 |
,
3、find(精而细)
(a)遍历指定路径下的所有文件(b)find 命令选项(由于命令选项过多,故只列出其功能,当需要使用时,可查阅相关文档) 1、与时间有关的选项 2、与使用者或组名有关的参数 3、与文件权限及名称有关的参数 4、额外可进行的动作 | -exec command | command为其他指令,-exec后面可接额外的指令来处理搜寻到的结果。| | -print | 将结果打印到屏幕上 |(c)格式:find [path] [option] [action]
参考书籍:
1、鸟哥的Linux私房菜
阅读全文
0 0
- Linux 指令与文件的搜寻 —— which whereis locate updatedb find
- linux学习(9)命令与文件的搜寻(which,whereis,locate,find)
- 【Linux】文件查找——which、whereis、locate、find...
- Linux 文件搜索指令 find locate whereis which type
- Linux指令--which,whereis,locate,find
- which,whereis,locate,find (档案的搜寻)之间的区别
- linux中搜寻文件或目录(which,whereis,locate,find)
- Linux基本功——五个查找文件的命令find,locate,whereis,which,type
- linux下的文件查找——type whereis which find locate
- linux/unix 文件查找指令——whereis/locate/find
- Linxu命令与文件的搜索 - which, whereis, locate, find
- 命令与文件的查询 which whereis locate find
- Linux的find、locate、whereis、which、type
- Linux 常用命令——which, whereis, locate, find
- linux which whereis locate find
- Linux下文件查找指令(which/whereis/locate/find
- Linux下文件查找指令which/whereis/locate/find
- 快速查找文件:locate和updatedb、whereis、which
- [agc017d]Game on Tree
- 实时通讯之Socket.io
- 对于 iOS 开发,人工智能意味着什么?
- bzoj 2161: 布娃娃
- 第四周—项目2
- Linux 指令与文件的搜寻 —— which whereis locate updatedb find
- Java 设计模式之中介者模式
- netty-socketio即时通讯
- 搭建Docker Swarm集群实战(一)(服务发现使用consul)
- 函数指针和指针函数的区分
- 数据挖掘_聚类/维数灾难
- 石子游戏
- Synchronized和ReentrantLock重入锁
- SpringMVC 拦截器不拦截静态资源的三种处理方式