如何檢視linux的系統log日誌

2021-06-18 00:59:43 字數 566 閱讀 8276

1.檢視系統日誌所存放的位置

通過nginx的配置檔案檢視 default 。

access_log /var/log/nginx/hej.access.log common;

2.檢視系統日誌的格式

通過nginx的配置檔案檢視 nginx.conf。(如果是apache,對應找到httpd檔案)

log_format apinpai '$remote_addr $host - [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';

3.通過命令進入日誌

cd /var/log/nginx/
4.檢視日誌 訪問前十的 資訊

cat hej.access.log | awk '' | sort | uniq -c | sort -nr | head -10cat hejian.access.log 

| awk '' | sort | uniq -c | sort -nr | head -10

Linux 檢視log日誌

tail f log 迴圈讀取日誌 tail 10000 log 顯示檔案的尾部 n 行內容 tail f log grep 關鍵字 迴圈讀取日誌,並根據關鍵字過濾 tail f log grep i 關鍵字 忽略字元大小寫 tail f log grep e 關鍵字a 關鍵字b 關鍵字c 過濾多個...

linux 系統如何檢視系統日誌

mv html 路徑 從 本地 複製到 遠端 scp home daisy full.tar.gz root 172.19.2.75 home root 然後會提示你輸入另外那台172.19.2.75主機的root使用者的登入密碼,接著就開始copy了 複製目錄加引數 r 即可 從 遠端 複製到 本...

androd系統檢視log命令

抓取上層log adb logcat c log1.txt 可以使用此命令在cmd模式下直接抓包 抓取kernel log adb shell cat proc kmsg 抓log style text decoration none color rgb 144,80,50 rel noopener...