{"id":158341,"date":"2019-09-26T10:01:22","date_gmt":"2019-09-26T02:01:22","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=158341"},"modified":"2019-09-17T13:16:42","modified_gmt":"2019-09-17T05:16:42","slug":"how-linux-log","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/how-linux-log.html","title":{"rendered":"Linux \u7cfb\u7edf\u4e2d\u7684\u7ba1\u7406\u65e5\u5fd7"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | Linux \u7cfb\u7edf\u4e0a\u7684\u65e5\u5fd7\u6587\u4ef6\u5305\u542b\u4e86\u5f88\u591a\u4fe1\u606f\u2014\u2014\u6bd4\u4f60\u6709\u65f6\u95f4\u67e5\u770b\u7684\u8fd8\u8981\u591a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8bae\uff0c\u544a\u8bc9\u4f60\u5982\u4f55\u6b63\u786e\u7684\u4f7f\u7528\u5b83\u4eec\u2026\u2026\u800c\u4e0d\u662f\u6df9\u6ca1\u5728\u5176\u4e2d\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u5728 Linux \u7cfb\u7edf\u4e0a\u7ba1\u7406\u65e5\u5fd7\u6587\u4ef6\u53ef\u80fd\u975e\u5e38\u5bb9\u6613\uff0c\u4e5f\u53ef\u80fd\u975e\u5e38\u75db\u82e6\u3002\u8fd9\u5b8c\u5168\u53d6\u51b3\u4e8e\u4f60\u6240\u8ba4\u4e3a\u7684\u65e5\u5fd7\u7ba1\u7406\u662f\u4ec0\u4e48\u3002<\/p>\n \u5982\u679c\u4f60\u8ba4\u4e3a\u662f\u5982\u4f55\u786e\u4fdd\u65e5\u5fd7\u6587\u4ef6\u4e0d\u4f1a\u8017\u5c3d\u4f60\u7684 Linux \u670d\u52a1\u5668\u4e0a\u7684\u6240\u6709\u78c1\u76d8\u7a7a\u95f4\uff0c\u90a3\u4e48\u8fd9\u4e2a\u95ee\u9898\u901a\u5e38\u5f88\u7b80\u5355\u3002Linux \u7cfb\u7edf\u4e0a\u7684\u65e5\u5fd7\u6587\u4ef6\u4f1a\u81ea\u52a8\u7ffb\u8f6c\uff0c\u7cfb\u7edf\u5c06\u53ea\u7ef4\u62a4\u56fa\u5b9a\u6570\u91cf\u7684\u7ffb\u8f6c\u65e5\u5fd7\u3002\u5373\u4fbf\u5982\u6b64\uff0c\u4e00\u773c\u770b\u53bb\u4e00\u7ec4\u4e0a\u767e\u4e2a\u6587\u4ef6\u53ef\u80fd\u4f1a\u8ba9\u4eba\u4e0d\u77e5\u6240\u63aa\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u770b\u770b\u65e5\u5fd7\u8f6e\u6362\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff0c\u4ee5\u53ca\u4e00\u4e9b\u6700\u76f8\u5173\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/p>\n \u81ea\u52a8\u65e5\u5fd7\u8f6e\u6362<\/strong><\/div>\n \u65e5\u5fd7\u6587\u4ef6\u662f\u7ecf\u5e38\u8f6e\u8f6c\u7684\u3002\u5f53\u524d\u7684\u65e5\u5fd7\u4f1a\u83b7\u5f97\u7a0d\u5fae\u4e0d\u540c\u7684\u6587\u4ef6\u540d\uff0c\u5e76\u5efa\u7acb\u4e00\u4e2a\u65b0\u7684\u65e5\u5fd7\u6587\u4ef6\u3002\u4ee5\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\u4e3a\u4f8b\u3002\u5bf9\u4e8e\u8bb8\u591a\u6b63\u5e38\u7684\u7cfb\u7edf messages \u6587\u4ef6\u6765\u8bf4\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u4e00\u4e2a\u5305\u7f57\u4e07\u8c61\u7684\u4e1c\u897f\u3002\u5982\u679c\u4f60 cd \u8f6c\u5230 \/var\/log \u5e76\u67e5\u770b\u4e00\u4e0b\uff0c\u4f60\u53ef\u80fd\u4f1a\u770b\u5230\u4e00\u7cfb\u5217\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6\uff0c\u5982\u4e0b\u6240\u793a:<\/p>\n $ ls -l syslog*\r\n-rw-r----- 1 syslog adm 28996 Jul 30 07:40 syslog\r\n-rw-r----- 1 syslog adm 71212 Jul 30 00:00 syslog.1\r\n-rw-r----- 1 syslog adm 5449 Jul 29 00:00 syslog.2.gz\r\n-rw-r----- 1 syslog adm 6152 Jul 28 00:00 syslog.3.gz\r\n-rw-r----- 1 syslog adm 7031 Jul 27 00:00 syslog.4.gz\r\n-rw-r----- 1 syslog adm 5602 Jul 26 00:00 syslog.5.gz\r\n-rw-r----- 1 syslog adm 5995 Jul 25 00:00 syslog.6.gz\r\n-rw-r----- 1 syslog adm 32924 Jul 24 00:00 syslog.7.gz<\/pre>\n |