CAT
cat – concatenate print files 连续的输出文件内容
用法
cat [-nbA] file
选项
TAC
tac – concatenate print files reverse 反序的查看文件
MORE
LESS
也是一页一页的翻动
比more的功能更强大
功能键
HEAD
head – output the first part of files 输出文件的前几行
用法
head [-n number] file
选项
DEMO
head -n 5 demo.txt
输出demo.txt的前五行
head -n -100 demo.txt
不输出demo.txt的后100行
TAIL
tail – output the last part of files 输出文件的后几行
用法
tail [-n number] file
选项
WHICH
which – locate a command 定位命令
which会在$PATH中查找命令
选项
注意
WHEREIS
whereis – locate the binary、shource and manual page files for a command
在$PATH中查找指令的执行(二进制)文件、源文件和操作手册
默认:binary、shource and manual page都会显示出来
选项
注意
LOCATE
locate – find files by name 查找文件
和which、whereis不同的是,locate不仅仅只在$PATH中查找
选项
注意
FIND
查找文件
在硬盘中查找
用法
find filename [option] [action]
选项
时间筛选-atime、-mtime、-ctime,后面接数字
用户筛选
文件属性筛选
其他可进行的操作
-exec command 执行其他指令
find / -size +500k -exec ls -l {} \;
在根目录下以及根目录的所有子目录下,搜索出大小大于500kb的文件,并且列出详细信息
{}:代表find搜索到的结果
\; :表示其他指令的结束
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有