{"id":237227,"date":"2022-03-20T08:37:12","date_gmt":"2022-03-20T00:37:12","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=237227"},"modified":"2022-03-07T10:38:22","modified_gmt":"2022-03-07T02:38:22","slug":"log-file-navigator","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/log-file-navigator.html","title":{"rendered":"Linux \u4e0b\u9ad8\u7ea7\u65e5\u5fd7\u6587\u4ef6\u67e5\u770b\u5668Log File Navigator"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nLog File Navigator\uff0c\u7b80\u79f0lnav\uff0c\u662f\u4e00\u6b3e\u9762\u5411\u5c0f\u89c4\u6a21\u7684\u9002\u7528\u4e8e Linux \u7684\u9ad8\u7ea7\u65e5\u5fd7\u6587\u4ef6\u67e5\u770b\u5668\u3002\u5b83\u662f\u4e00\u4e2a\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u7406\u89e3\u60a8\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u8ba9\u60a8\u8f7b\u677e\u627e\u5230\u95ee\u9898\uff0c\u51e0\u4e4e\u4e0d\u9700\u8981\u4ec0\u4e48\u8bbe\u7f6e\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

lnav \u53ef\u4ee5\u5373\u65f6\u89e3\u538b\u7f29\u6240\u6709\u538b\u7f29\u7684\u65e5\u5fd7\u6587\u4ef6\u5e76\u5c06\u5b83\u4eec\u5408\u5e76\u5728\u4e00\u8d77\u4ee5\u83b7\u5f97\u6f02\u4eae\u7684\u663e\u793a\u3002\u6839\u636e\u9519\u8bef\/\u8b66\u544a\u7684\u7c7b\u578b\u5bf9\u663e\u793a\u8fdb\u884c\u89e3\u6790\u548c\u683c\u5f0f\u5316 - \u8fd9\u6709\u52a9\u4e8e\u5feb\u901f\u6d4f\u89c8\u6570\u5343\u6761\u65e5\u5fd7\uff0c\u7279\u522b\u662f\u5728\u670d\u52a1\u5668\u4e2d\u3002<\/p>\n

\u5728\u5206\u6790\u65e5\u5fd7\u65f6\uff0c\u65f6\u95f4\u6233\u975e\u5e38\u91cd\u8981\u3002\u6240\u4ee5 lnav \u57fa\u4e8e\u65f6\u95f4\u6233\u5408\u5e76\u591a\u4e2a\u65e5\u5fd7\uff0c\u8fd9\u5bf9\u4e8e\u8ffd\u8e2a\u7cfb\u7edf\u95ee\u9898\u975e\u5e38\u6709\u5e2e\u52a9\u3002<\/p>\n

\u5927\u591a\u6570\u91cd\u8981\u7684\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f\u68c0\u6d4b\u662f\u5185\u7f6e\u7684\uff0c\u89c1\u4e0b\u6587\uff1a<\/p>\n

    \n
  • \u901a\u7528 Web \u8bbf\u95ee\u65e5\u5fd7\u683c\u5f0f<\/li>\n
  • CUPS page_log<\/li>\n
  • Syslog<\/li>\n
  • Glog<\/li>\n
  • VMware ESXi\/vCenter \u65e5\u5fd7<\/li>\n
  • dpkg.log<\/li>\n
  • uwsgi<\/li>\n
  • \u201cGeneric\u201d - \u4efb\u4f55\u4ee5\u65f6\u95f4\u6233\u5f00\u5934\u7684\u6d88\u606f<\/li>\n
  • Strace<\/li>\n
  • sudo<\/li>\n
  • GZIP\u3001BZIP<\/li>\n<\/ul>\n

    \u8fd9\u8fd8\u4e0d\u662f\u5168\u90e8\uff0clnav \u8fd8\u5177\u6709\u4ee5\u4e0b\u529f\u80fd\uff0c\u8fd9\u4f7f\u5176\u6210\u4e3a Linux \u7cfb\u7edf\u7684\u91cd\u8981\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

      \n
    • \u6839\u636e\u6b63\u5219\u8868\u8fbe\u5f0f\u8fc7\u6ee4\u6d88\u606f<\/li>\n
    • \u9519\u8bef\u7684\u65f6\u95f4\u7ebf\u89c6\u56fe<\/li>\n
    • \u6f02\u4eae\u7684\u6253\u5370\u89c6\u56fe - \u6709\u52a9\u4e8e\u91cd\u65b0\u683c\u5f0f\u5316<\/li>\n
    • \u4f7f\u7528 SQL \u67e5\u8be2\u65e5\u5fd7<\/li>\n
    • \u65e5\u5fd7\u5728\u88ab\u641c\u7d22\u65f6\u5b9e\u65f6\u66f4\u65b0<\/li>\n<\/ul>\n

      \u901a\u8fc7\u6b63\u5219\u8868\u8fbe\u5f0f\u9ad8\u4eae\u663e\u793a\u8bed\u6cd5\uff08\u5047\u8bbe\u60a8\u60f3\u5728\u6574\u4e2a\u65e5\u5fd7\u4e2d\u627e\u51fa\u4e00\u4e2a IP \u5730\u5740\uff09<\/p>\n

      \u4ece\u663e\u793a\u7684\u65e5\u5fd7\u4e2d\u5b8c\u6210\u4efb\u4f55\u5355\u8bcd\u7684\u5236\u8868\u7b26\uff01<\/p>\n

      \"\"<\/p>\n

      \u4ee5\u4e0a\u5c4f\u5e55\u622a\u56fe\u663e\u793a\u4e86\u4e00\u4e2a syslog \u6587\u4ef6\u3002\u65e5\u5fd7\u884c\u4ee5\u9ad8\u4eae\u663e\u793a\u3002\u9519\u8bef\u4e3a\u7ea2\u8272\uff0c\u8b66\u544a\u4e3a\u9ec4\u8272\u3002\u8981\u67e5\u770b\u4ee5\u4e0a\u5c4f\u5e55\u622a\u56fe\u4e0a\u7684\u529f\u80fd\u5e76\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u8bbf\u95ee\u6b64\u9875\u9762\u3002<\/p>\n

      \u5982\u4f55\u5b89\u88c5<\/strong><\/div>\n

      Lnav \u76ee\u524d\u7684\u6700\u65b0\u7248\u672c\u662f0.10.1\u3002<\/p>\n

      Debian\/Ubuntu\/LinuxMint \u00a0\u4e0b\u4f60\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ sudo snap install lnav<\/pre>\n

      \u5728 RHEL\/CentOS \u4e0a\u5b89\u88c5 lnav<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ sudo yum install lnav<\/pre>\n

      \u5728 Fedora \u4e0a\u5b89\u88c5 lnav<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ sudo dnf install lnav<\/pre>\n

      \u5728 openSUSE \u4e0a\u5b89\u88c5 lnav<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ sudo zypper install lnav<\/pre>\n

      [\u5728 Mageia \u4e0a\u5b89\u88c5 lnav]<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ sudo urpmi lnav<\/pre>\n

      \u5728\u57fa\u4e8e Arch Linux \u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5 lnav<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ yaourt -S lnav<\/pre>\n

      \u4e5f\u53ef\u4ee5\u4f7f\u7528\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\uff08\u5c31\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6lnav\uff09\uff0c\u5728 Ubuntu\u3001Linux Mint\u3001Fedora, RHEL \u7b49\u89e3\u538b\u540e\u901a\u8fc7\u7ec8\u7aef\u5373\u53ef\u8fd0\u884c\uff08.\/lnav\uff09\u3002<\/p>\n

      \u5982\u4f55\u4f7f\u7528
      \n\u4f60\u53ef\u4ee5\u4e0d\u5e26\u53c2\u6570\u6267\u884c\u5b83\u4ee5\u67e5\u770b\u9ed8\u8ba4\u6587\u4ef6\u96c6\u3002<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ lnav<\/pre>\n

      \u4f7f\u7528 lnav \u67e5\u770b\u7279\u5b9a\u65e5\u5fd7\u6587\u4ef6<\/p>\n

      \u8981\u7528 lnav \u67e5\u770b\u7279\u5b9a\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u5728 lnav \u547d\u4ee4\u540e\u9762\u6dfb\u52a0\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u3002\u4f8b\u5982\u6211\u4eec\u60f3\u770b \/var\/log\/dpkg.log \u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u4e0b\u56fe\uff1a<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ lnav \/var\/log\/dpkg.log<\/pre>\n

      \u67e5\u770b\u591a\u4e2a\u65e5\u5fd7\u6587\u4ef6<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ lnav \/var\/log\/dpkg.log \/var\/log\/kern.log<\/pre>\n

      \u67e5\u770b\u538b\u7f29\u7684\u65e5\u5fd7\u6587\u4ef6<\/p>\n

      linuxmi@linuxmi:~\/www.linuxmi.com$ lnav -r \/var\/log\/Xorg.0.log.old.gz<\/pre>\n

      \u76f4\u65b9\u56fe\u89c6\u56fe<\/p>\n

      \u9996\u5148\u8fd0\u884c lnav \u7136\u540e\u6309 i \u952e\u5207\u6362\u5230\/\u51fa\u76f4\u65b9\u56fe\u89c6\u56fe\u3002<\/p>\n

      \u67e5\u770b\u65e5\u5fd7\u89e3\u6790\u5668\u7ed3\u679c<\/p>\n

      \u9996\u5148\u8fd0\u884c lnav \u7136\u540e\u6309 p \u952e\u6253\u5f00\u663e\u793a\u65e5\u5fd7\u89e3\u6790\u5668\u7ed3\u679c\u3002\u4f7f\u7528 lnav \u67e5\u770b\u7279\u5b9a\u65e5\u5fd7\u6587\u4ef6<\/p>\n

      \u8981\u7528 lnav \u67e5\u770b\u7279\u5b9a\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u5728 lnav \u547d\u4ee4\u540e\u9762\u6dfb\u52a0\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u3002\u4f8b\u5982\u6211\u4eec\u60f3\u770b \/var\/log\/dpkg.log \u65e5\u5fd7\u6587\u4ef6\u3002<\/p>\n

      \u8bed\u6cd5\u9ad8\u4eae<\/p>\n

      \u4f60\u53ef\u4ee5\u641c\u7d22\u4efb\u4f55\u7ed9\u5b9a\u7684\u5b57\u7b26\u4e32\uff0c\u5b83\u4f1a\u5728\u5c4f\u5e55\u4e0a\u9ad8\u4eae\u663e\u793a\u3002\u9996\u5148\u8fd0\u884c lnav \u7136\u540e\u6309 \/ \u952e\u5e76\u8f93\u5165\u4f60\u60f3\u67e5\u627e\u7684\u5b57\u7b26\u4e32\u3002\u4e3a\u4e86\u6d4b\u8bd5\uff0c\u6211\u641c\u7d22\u5b57\u7b26\u4e32 ubuntu\uff0c\u770b\u4e0b\u9762\u7684\u622a\u56fe\u3002
      \n\"\"
      \n\u4f60\u53ef\u4ee5\u5728 GitHub\u4e0a\u62a5\u544a\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

      lnav \u53ef\u4ee5\u5373\u65f6\u89e3\u538b\u7f29\u6240\u6709\u538b\u7f29\u7684\u65e5\u5fd7\u6587\u4ef6\u5e76\u5c06\u5b83\u4eec\u5408\u5e76\u5728\u4e00\u8d77\u4ee5\u83b7\u5f97\u6f02\u4eae\u7684\u663e\u793a\u3002\u6839\u636e\u9519\u8bef\/\u8b66\u544a\u7684\u7c7b\u578b\u5bf9\u663e\u793a\u8fdb\u884c\u89e3 […]<\/p>\n","protected":false},"author":323,"featured_media":231486,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-237227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=237227"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237227\/revisions"}],"predecessor-version":[{"id":237236,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237227\/revisions\/237236"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/231486"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=237227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=237227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=237227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}