版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
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 更加详细的输出文件类型