{"id":288390,"date":"2023-11-27T04:01:41","date_gmt":"2023-11-26T20:01:41","guid":{"rendered":"https:\/\/lrxjmw.cn\/lsjzkmldsyff.html"},"modified":"2023-11-27T04:01:41","modified_gmt":"2023-11-26T20:01:41","slug":"lsjzkmldsyff","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lsjzkmldsyff.html","title":{"rendered":"Linux\u65f6\u95f4\u67e5\u770b\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u5e38\u7528\u7684\u65f6\u95f4"},"content":{"rendered":"

Linux<\/a>\u65f6\u95f4\u67e5\u770b\u547d\u4ee4<\/a>\u7684\u4f7f\u7528\u65b9\u5f0f<\/p>\n

\u67e5\u770b\u7cfb\u7edf\u7248\u672clinux\u547d\u4ee4_\u600e\u4e48\u67e5\u770blinux\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c_linux\u67e5\u770b\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u53f7<\/p>\n

Linux\u64cd\u4f5c\u7cfb\u7edf<\/a>\u662f\u4e00\u79cd\u5f00\u6e90\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u670d\u52a1\u5668\u548c\u5d4c\u5165\u5f0f\u8bbe\u5907\u4e2d\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u65f6\u95f4\u7684\u786e\u5207\u6027\u5bf9\u4e8e\u8bb8\u591a\u5e94\u7528\u7a0b\u5e8f\u548c\u7cfb\u7edf\u4efb\u52a1\u5341\u5206\u91cd\u8981\u3002\u672c\u6587\u5c06\u4ecb\u7ecdLinux\u7cfb\u7edf\u4e2d\u5e38\u7528\u7684\u65f6\u95f4\u67e5\u770b\u547d\u4ee4\uff0c\u5e2e\u52a9\u7528\u6237\u786e\u5207\u5730\u83b7\u53d6\u548c\u7ba1\u7406\u65f6\u95f4\u4fe1\u606f\u3002<\/p>\n

1.\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2dlinux \u53d1\u90ae\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528date\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

date<\/p>\n

\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u4f1a\u8fd4\u56de\u5f53\u524d\u7684\u65e5\u671f\u548c\u65f6\u95f4\u4fe1\u606f\uff0c\u5305\u62ec\u5e74\u3001\u6708\u3001\u65e5\u3001\u65f6\u3001\u5206\u3001\u79d2\u7b49\u3002\u8bf8\u5982\uff1a<\/p>\n

ThuJan100:00:00CST1970<\/p>\n

2.\u67e5\u770b\u7cfb\u7edf\u542f\u52a8\u65f6\u95f4<\/p>\n

\u4e0d\u4ec5\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\uff0c\u6709\u65f6\u4faf\u6211\u4eec\u4e5f\u987b\u8981\u4e86\u89e3\u7cfb\u7edf\u7684\u542f\u52a8\u65f6\u95f4\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528uptime\u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u7684\u8fd0\u884c\u65f6\u95f4\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

uptime<\/p>\n

\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u4f1a\u8fd4\u56de\u7cfb\u7edf\u7684\u8fd0\u884c\u65f6\u95f4\uff0c\u4ee5\u53ca\u5f53\u524d\u7cfb\u7edf\u7684\u8d1f\u8f7d\u60c5\u51b5\u3002\u8bf8\u5982\uff1a<\/p>\n

00:00:00up1day,1:30,1user,loadaverage:0.00,0.01,0.05<\/p>\n

3.\u67e5\u770b\u65f6\u95f4\u6233<\/p>\n

\u65f6\u95f4\u6233\u662f\u6307\u4ece1970\u5e741\u67081\u65e500:00:00UTC\u5230\u5f53\u524d\u65f6\u95f4\u7684\u79d2\u6570\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528date\u547d\u4ee4\u7684+%s\u9009\u9879\u6765\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

date+%s<\/p>\n

\u6267\u884c\u8be5\u547d\u4ee4\u540elinux\u5b66\u4e60\uff0c\u7cfb\u7edf\u4f1a\u8fd4\u56de\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\u3002\u8bf8\u5982\uff1a<\/p>\n

1612345678<\/p>\n

4.\u8bbe\u7f6e\u7cfb\u7edf\u65f6\u95f4<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528date\u547d\u4ee4\u6765\u8bbe\u7f6e\u7cfb\u7edf\u65f6\u95f4\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

linux\u67e5\u770b\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u53f7_\u600e\u4e48\u67e5\u770blinux\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c_\u67e5\u770b\u7cfb\u7edf\u7248\u672clinux\u547d\u4ee4<\/p>\n

sudodate-s\"YYYY-MM-DDHH:MM:SS\"<\/p>\n

\u5176\u4e2d\uff0cYYYY\u8868\u793a\u5e74\u4efd\uff0cMM\u8868\u793a\u6708\u4efd\uff0cDD\u8868\u793a\u65e5\u671f\uff0cHH\u8868\u793a\u5c0f\u65f6\uff0cMM\u8868\u793a\u5206\u949f\uff0cSS\u8868\u793a\u79d2\u949f\u3002\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u7684\u65f6\u95f4\u4f1a\u88ab\u8bbe\u7f6e\u4e3a\u6307\u5b9a\u7684\u65f6\u95f4\u3002<\/p>\n

5.\u540c\u6b65\u7f51\u8def\u65f6\u95f4<\/p>\n

\u4e3a\u4e86\u4fdd\u8bc1\u7cfb\u7edf\u65f6\u95f4\u7684\u786e\u5207\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0e\u7f51\u8def\u65f6\u95f4\u670d\u52a1\u5668\u540c\u6b65\u6765\u66f4\u65b0\u7cfb\u7edf\u65f6\u95f4\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528ntpdate\u547d\u4ee4\u6765\u540c\u6b65\u7f51\u8def\u65f6\u95f4\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

sudontpdate<\/p>\n

linux\u67e5\u770b\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\u53f7_\u67e5\u770b\u7cfb\u7edf\u7248\u672clinux\u547d\u4ee4_\u600e\u4e48\u67e5\u770blinux\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c<\/p>\n

\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u4f1a\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u65f6\u95f4\u540c\u6b65\uff0c\u66f4\u65b0\u7cfb\u7edf\u65f6\u95f4\u3002<\/p>\n

6.\u67e5\u770b\u65f6\u533a\u4fe1\u606f<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\u600e\u4e48\u67e5\u770blinux\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c<\/strong>\uff0c\u53ef\u4ee5\u4f7f\u7528timedatectl\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u533a\u4fe1\u606f\u3002\u8be5\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\u5982\u4e0b\uff1a<\/p>\n

timedatectl<\/p>\n

\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u7cfb\u7edf\u4f1a\u8fd4\u56de\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u533a\u4fe1\u606f\u600e\u4e48\u67e5\u770blinux\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c<\/strong>\uff0c\u5305\u62ec\u65f6\u533a\u540d\u79f0\u3001\u65f6\u533a\u504f\u659c\u7b49\u3002\u8bf8\u5982\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528date\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528uptime\u547d\u4ee4\u6765\u67e5\u770b\u7cfb\u7edf\u7684\u8fd0\u884c\u65f6\u95f4\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528date\u547d\u4ee4\u7684+%s\u9009\u9879\u6765\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u7684\u65f6\u95f4\u6233\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528timedatectl\u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u533a\u4fe1\u606f\u3002<\/p>\n","protected":false},"author":1,"featured_media":288391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-288390","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288390","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=288390"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288390\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/288391"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=288390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=288390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=288390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}