Linux檢視檔案命令及其檢視檔案頭尾的命令
阿新 • • 發佈:2019-01-04
檢視檔案命令
cat:檢視檔案的所有內容(適合小的檔案)
more:分頁檢視檔案
[[email protected] ~]# more install.log
按空格向下翻頁,按q退出
less:更強大的分頁檢視檔案
可是使用PgUp向上翻頁,PgDn向下翻頁
使用ctrt+f向下翻頁,ctrl+b向上翻頁
可以使用方向鍵上下鍵逐行翻頁
使用方向的左右鍵,左右翻屏
按q退出
檢視頭命令
head檢視檔案頭
[[email protected] ~]# head install.log
-n 後面跟顯示的行數
[[email protected]
tail檢視檔案尾
[[email protected] ~]# tail install.log
-n 後面跟顯示的行數
[[email protected] ~]# tail -n 30 install.log
-f:動態顯示
[[email protected] ~]# tail -f hello.txt
hello3
hello33
使用場景:動態顯示日誌