00. 目录
01. 命令概述
whereis命令用来定位命令的二进制程序、源代码文件和man手册页等相关文件的路径。
whereis命令查找速度非常快,因为它不是在磁盘中乱找,而是在一个数据库中查询; 数据库是linux系统自动创建的,包含有本地所有文件的信息,并且每天通过自动执行updatedb命令更新一次。正因为这样,whereis命令的搜索结果有时候会不准确,比如刚添加的文件可能搜不到, 原因就是该数据库文件没有被更新。
02. 命令格式
whereis [选项] 文件
03. 常用选项
用法:
whereis [选项] 文件
选项:
-b 只搜索二进制文件
-B <目录> 定义二进制文件查找路径
-m 只搜索 man 手册
-M <目录> 定义 man 手册查找路径
-s 只搜索源代码
-S <目录> 定义源代码查找路径
-f 终止 <目录> 参数列表
-u 搜索不常见记录
-l 输出有效查找路径
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
04. 参考示例
[root@localhost ~]# whereis git
git: /usr/bin/git /usr/share/man/man1/git.1.gz
[root@localhost ~]# whereis -b git
git: /usr/bin/git
[root@localhost ~]# whereis -m git
git: /usr/share/man/man1/git.1.gz
[root@localhost ~]# whereis -s git
git:
[root@localhost ~]# whereis -u git
git: /usr/bin/git /usr/share/man/man1/git.1.gz
[root@localhost ~]# whereis -l git
bin: /usr/bin
bin: /usr/sbin
bin: /usr/lib
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
05. 附录
Frame Profiler概述
DevEco Studio内置Profiler分析调优工具,其中Frame分析调优功能,用于录制GPU数据信息,录制完成展开之后的子泳道对应录制过程中各个进程的帧数据,主要用于深度分析应用或服务卡顿丢帧的原因。此外,Frame任务窗口还集成了Time、CPU场景分析任务的功能,方便开发者在分析丢帧数据时同步对比同一时段的其他资源占用情况。
场景示例
如下代码使用了Grid来实现一个网格,但是在外层套了3层stack容器,会导致组件刷新和渲染耗时长,文章后续将以本案例场景来简单介绍Frame Profiler的使用。
@Entry
@Component
struct Index {
@State children: Number[] = Array.from(Array(2000), (_v, k) => k);
build() {
Scroll() {
Grid() {
ForEach(this.children, (item) => {
GridItem() {
Stack() {
Stack() {
Stack() {
Text(item.toString())
}
}
}
}
}, item => item)
}
.columnsTemplate('1fr 1fr 1fr 1fr')
.columnsGap(0)
.rowsGap(0)
.size({ width: "100%", height: "100%" })
}
}
}
class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}">
评论记录:
回复评论: