cat
命令
cat nginx.conf # 查看nginx.conf文件内容,全部显示
cat nginx.conf fcgi.conf # 查看多个文件内容
cat -n index.php #查看文件内容并从 1 开始添加序号
less
分屏显示文件内容
less index.php # enter 下一行,空格下一屏,q退出
more
分屏显示文件内容
more -10 index.php #每屏显示10行数据
more +20 index.php #从20行开始显示
enter 下一行,空格下一屏,q退出
tail
:查看日志的神器
tail index.php #默认显示文件尾部 10 行
tail -30 index.php #显示文件尾部 2 行
head
head index.php #显示文件内容,默认显示 10 行
head -10 index.php #显示文件头部 10 行内容
nl
nl index.php #查看文件内容并加行号显示示