1.head
head -n 5 /root/10.py 输出该文件前5行内容
head -c 5 /root/10.py 输出文件前5个字节内容
2.tail
tail命令与head命令相反,打印指定输入的结尾部分的内容
默认情况下打印最后10行的内容
tail -n 10 /root/10.py 打印文件最后的10行
tail -f /root/10.py 打印文件新写入的行
tail -f /root/10.py --pid=24186 在特定进程结束后终结tail命令
3.file
file /root/10.py 输出文件类型
file -i /root/10.py 更加详细的输出文件类型
head tail file命令
最新推荐文章于 2022-08-13 05:54:00 发布