1.查看實時日志:
tail -f nohup.out
2.分頁查看所有日志:
cat nohup.out | more
4.分頁查看前N行日志:
tail -n 1000 nohup.out | more
5.查看實時日志並檢索關鍵字:
tail -f nohup.out | grep "關鍵字"
6.檢索日志,並顯示該條日志的前后N行記錄:
cat nohup.out | grep -n -B10 -A10 "關鍵字"
7.查看日志,從第1000行開始,顯示500行:
cat nohup.out | tail -n +1000| head -n 500
### 8.查看日志,顯示1000行到1500行: ```shell cat nohup.out | head -n 1500| tail -n +1000
9.刪除包括關鍵詞的行:
sed -i '/關鍵詞/d' nohup.out