cat
一次性显示文件所有内容,更适合查看小的文件
【常用参数】
-n 显示行号;
-n
less
分页显示文件内容,更适合查看大的文件
【参数】
-n 指定行数 tail cloud-init.log -n 2
tail cloud-init.log -n 2
-f 会每过1秒检查下文件是否有更新内容,也可以用 -s 参数指定间隔时间 tail -f -s 4 xxx.log
-f
-s
tail -f -s 4 xxx.log
touch创建一个文件
touch