{"id":270365,"date":"2023-04-23T04:12:38","date_gmt":"2023-04-22T20:12:38","guid":{"rendered":"https:\/\/lrxjmw.cn\/cxgwjzldesdt.html"},"modified":"2023-04-23T04:12:38","modified_gmt":"2023-04-22T20:12:38","slug":"cxgwjzldesdt","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/cxgwjzldesdt.html","title":{"rendered":"chattrchattr\u4fee\u6539\u6587\u4ef6\u5728Linux\u7b2c\u4e8c\u4e0a\u7684\u7279\u6709\u5c5e\u6027\u7b26\u53f7\u6a21\u5f0f"},"content":{"rendered":"

chattr<\/p>\n

chattr\u66f4\u6539\u6587\u4ef6\u5728Linux<\/a>\u7b2c\u4e8c\u6269\u5145\u6587\u4ef6\u7cfb\u7edf(E2fs)\u4e0a\u7684\u7279\u6709\u5c5e\u6027<\u7cfb\u7edf<\/a>>\u7b26\u53f7\u6a21\u5f0f\u6709+-=[ASacdisu]\u51e0\u79cd\u683c\u5f0f.<\/p>\n

\u64cd\u4f5c\u7b26`+'\u62ff\u6765\u5728\u6587\u4ef6\u5df2\u6709\u5c5e\u6027\u7684\u57fa\u7840\u4e0a\u964d\u4f4e\u9009\u53d6\u7684\u5c5e\u6027;`-'\u62ff\u6765\u53bb\u9664\u6587\u4ef6\u4e0a\u7684\u9009\u53d6\u7684\u5c5e\u6027;\u800c`='\u62ff\u6765\u6307\u5b9a\u8be5\u6587\u4ef6\u7684\u60df\u4e00\u5c5e\u6027.<\/p>\n

\u5b57\u7b26`ASacdisu'\u7528\u4f5c\u6587\u4ef6\u65b0\u5c5e\u6027\u7684\u9009\u9879:\u4e0d\u66f4\u65b0atime(A),\u540c\u6b65\u66f4\u65b0(S),\u53ea\u80fd\u6dfb\u52a0(a),\u538b\u7f29(c),\u4e0d\u53ef\u53d8(i)linux\u6587\u4ef6\u7cfb\u7edf\u7684\u8d85\u7ea7\u5757<\/strong>,\u4e0d\u53ef\u8f6c\u79fb(d),\u5220\u6389\u4fdd\u62a4(s)\u4ee5\u53ca\u4e0d\u53ef\u5220\u6389(u).<\/p>\n

-R<\/p>\n

\u9012\u5f52\u5730\u66f4\u6539\u5185\u5bb9\u4ecb\u7ecd\u4ee5\u53ca\u5176\u4e0b\u5185\u5bb9\u7684\u5c5e\u6027.\u82e5\u679c\u5728\u9012\u5f52\u5185\u5bb9\u4ecb\u7ecd\u65f6\u9047\u89c1\u4e86\u7b26\u53f7\u94fe\u63a5,\u904d\u5386\u5c06\u8df3\u8fc7.<\/p>\n

-V<\/p>\n

\u8be6\u7ec6\u5730\u7ed9\u51fachattr\u7684\u8f93\u51fa\u4fe1\u606f\u5e76\u590d\u5370\u51fa\u7a0b\u5e8f\u7684\u7248\u672c.<\/p>\n

-vversion<\/p>\n

\u8bbe\u7f6e\u6587\u4ef6\u7cfb\u7edf\u7684\u7248\u672c.<\/p>\n

\u5f53\u66f4\u6539\u8bbe\u7f6e\u4e86'A'\u5c5e\u6027\u7684\u6587\u4ef6\u65f6,\u5b83\u7684atime\u8bb0\u5f55\u4e0d\u4f1a\u6539\u53d8.\u8fd9\u53ef\u4ee5\u5728\u7535\u8111\u7b14\u8bb0\u672c\u7cfb\u7edf\u4e2d\u9632\u6b62\u4e2a\u522bc\u76d8I\/O\u5904\u7406.<\/p>\n

\u8bbe\u7f6e\u4e86`a'\u5c5e\u6027\u7684\u6587\u4ef6\u53ea\u80fd\u5728\u6dfb\u52a0\u6a21\u5f0f\u4e0b\u6253\u5f00\u7528\u4e8e\u5199\u5165.\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u6216\u6d88\u9664\u8be5\u5c5e\u6027.<\/p>\n

\u8bbe\u7f6e\u4e86`c'\u5c5e\u6027\u7684\u6587\u4ef6\u5728c\u76d8\u4e0a\u7531\u5185\u6838\u624b\u52a8\u8fdb\u884c\u538b\u7f29\u5904\u7406.\u4ece\u8be5\u6587\u4ef6\u8bfb\u53d6\u65f6\u8fd4\u56de\u7684\u662f\u672a\u538b\u7f29\u7684\u6570\u636e.\u5bf9\u8be5\u6587\u4ef6\u7684\u4e00\u6b21\u5199\u5165\u4f1a\u5728\u4fdd\u5b58\u5b83\u4eec\u5230c\u76d8\u4e4b\u524d\u8fdb\u884c\u6570\u636e\u538b\u7f29.<\/p>\n

\u8bbe\u7f6e\u4e86`d'\u5c5e\u6027\u7684\u6587\u4ef6\u4e0d\u80fd\u5bf9\u5176\u8fd0\u884cdump(8)\u7a0b\u5e8f\u8fdb\u884c\u5907\u4efd.<\/p>\n

\u8bbe\u7f6e\u4e86`i'\u5c5e\u6027\u7684\u6587\u4ef6\u4e0d\u80fd\u8fdb\u884c\u66f4\u6539:\u4f60\u65e2\u4e0d\u80fd\u5220\u6389\u5b83linux\u5f00\u53d1\u57f9\u8bad,\u4e5f\u4e0d\u80fd\u7ed9\u5b83\u91cd\u65b0\u547d\u540d,\u4f60\u4e0d\u80fd\u5bf9\u8be5\u6587\u4ef6\u521b\u5efa\u94fe\u63a5,\u5e76\u4e14\u4e5f\u4e0d\u80fd\u5bf9\u8be5\u6587\u4ef6\u5199\u5165\u4efb\u4f55\u6570\u636e.\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u6216\u6d88\u9664\u8be5\u5c5e\u6027.<\/p>\n

\u5f53\u5220\u6389\u8bbe\u7f6e\u4e86`s'\u5c5e\u6027\u7684\u6587\u4ef6\u65f6,\u5c06\u5bf9\u5176\u6570\u636e\u5757\u6e05\u96f6\u5e76\u5199\u56de\u5230c\u76d8\u4e0a.<\/p>\n

\u5f53\u66f4\u6539\u8bbe\u7f6e\u4e86`S'\u5c5e\u6027\u7684\u6587\u4ef6\u65f6linux\u4e3b\u673a,\u66f4\u6539\u4f1a\u540c\u6b65\u5199\u5165\u5230c\u76d8\u4e0a;\u8fd9\u4e0e\u5e94\u7528\u5230\u6587\u4ef6\u5b50\u7cfb\u7edf\u4e0a\u7684`sync'\u6302\u8f7d\u9009\u9879\u6709\u76f8\u540c\u7684\u7597\u6548.<\/p>\n

\u5f53\u5220\u6389\u8bbe\u7f6e\u4e86`u'\u5c5e\u6027\u7684\u6587\u4ef6\u65f6linux\u6587\u4ef6\u7cfb\u7edf\u7684\u8d85\u7ea7\u5757<\/strong>,\u5c06\u4f1a\u4fdd\u5b58\u5176\u5185\u5bb9.\u8fd9\u4fc3\u4f7f\u7528\u6237\u53ef\u4ee5\u6073\u6c42\u6062\u590d\u88ab\u5220\u6389\u7684\u6587\u4ef6.<\/p>\n

\u4f8b:<\/p>\n

\u590d\u5236\u4ee3\u7801\u4ee3\u7801\u5982\u4e0b:<\/p>\n

[root@localhost~]#chattr+inginx.conf#\u8bbe\u7f6e\u8be5\u6587\u4ef6\u4e0d\u80fd\u8fdb\u884c\u4efb\u4f55\u5f62\u52bf\u7684\u66f4\u6539<\/p>\n

[root@localhost~]#mvnginx.confnginx.conf_bak<\/p>\n

mv:\u96be\u4ee5\u5c06\"nginx.conf\"\u8054\u901a\u81f3\"nginx.conf_bak\":\u4e0d\u5bb9\u8bb8\u7684\u64cd\u4f5c<\/p>\n

[root@localhost~]#lsattrnginx.conf#\u67e5\u770bchattr\u8bbe\u7f6e\u7684\u6743\u9650<\/p>\n

----i--------e-nginx.conf<\/p>\n

linux\u7cfb\u7edf.ini\u6587\u4ef6_linux\u6587\u4ef6\u7cfb\u7edf\u7684\u8d85\u7ea7\u5757_\u5982\u4f55\u5c06\u672c\u673a\u4e0a\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u865a\u62df\u673a\u4e0b\u7684linux\u7cfb\u7edf\u4e0b<\/p>\n

[root@localhost~]#chattr-inginx.conf#\u53d6\u6d88-i\u7684\u6743\u9650\u8bbe\u7f6e<\/p>\n

[root@localhost~]#lsattrnginx.conf#\u67e5\u770bchattr\u8bbe\u7f6e\u7684\u6743\u9650<\/p>\n

-------------e-nginx.conf<\/p>\n

lsattr<\/p>\n

lsattr\u663e\u793a\u6587\u4ef6\u5728Linux\u7b2c\u4e8c\u6269\u5145\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u7279\u6709\u5c5e\u6027<\/p>\n

-R<\/p>\n

\u9012\u5f52\u5730\u5217\u4e3e\u5185\u5bb9\u4ecb\u7ecd\u4ee5\u53ca\u5176\u4e0b\u5185\u5bb9\u7684\u5c5e\u6027.<\/p>\n

-V<\/p>\n

linux\u6587\u4ef6\u7cfb\u7edf\u7684\u8d85\u7ea7\u5757_linux\u7cfb\u7edf.ini\u6587\u4ef6_\u5982\u4f55\u5c06\u672c\u673a\u4e0a\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u865a\u62df\u673a\u4e0b\u7684linux\u7cfb\u7edf\u4e0b<\/p>\n

\u663e\u793a\u7a0b\u5e8f\u7248\u672c.<\/p>\n

-a<\/p>\n

\u5217\u4e3e\u5185\u5bb9\u4ecb\u7ecd\u4e2d\u7684\u6240\u6709\u6587\u4ef6,\u5305\u62ec\u4ee5`.'\u5f00\u5934\u7684\u6587\u4ef6\u7684\u5c5e\u6027.<\/p>\n

-d<\/p>\n

\u4ee5\u5217\u4e3e\u5176\u5b83\u6587\u4ef6\u7684\u5f62\u5f0f\u90a3\u6837\u5217\u4e3e\u5185\u5bb9\u4ecb\u7ecd\u7684\u5c5e\u6027,\u800c\u4e0d\u5217\u4e3e\u5176\u4e0b\u7684\u5185\u5bb9.<\/p>\n

-v<\/p>\n

\u663e\u793a\u6587\u4ef6\u7248\u672c.<\/p>\n

\u4f8b:<\/p>\n

\u590d\u5236\u4ee3\u7801\u4ee3\u7801\u5982\u4e0b:<\/p>\n

[root@localhost~]#chattr+inginx.conf#\u8bbe\u7f6e\u8be5\u6587\u4ef6\u4e0d\u80fd\u8fdb\u884c\u4efb\u4f55\u5f62\u52bf\u7684\u66f4\u6539<\/p>\n

[root@localhost~]#mvnginx.confnginx.conf_bak<\/p>\n

mv:\u96be\u4ee5\u5c06\"nginx.conf\"\u8054\u901a\u81f3\"nginx.conf_bak\":\u4e0d\u5bb9\u8bb8\u7684\u64cd\u4f5c<\/p>\n

[root@localhost~]#lsattrnginx.conf#\u67e5\u770bchattr\u8bbe\u7f6e\u7684\u6743\u9650<\/p>\n

----i--------e-nginx.conf<\/p>\n

[root@localhost~]#chattr-inginx.conf#\u53d6\u6d88-i\u7684\u6743\u9650\u8bbe\u7f6e<\/p>\n

[root@localhost~]#lsattrnginx.conf#\u67e5\u770bchattr\u8bbe\u7f6e\u7684\u6743\u9650<\/p>\n

-------------e-nginx.conf<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4fee\u6539\u6587\u4ef6\u5728Linux\u7b2c\u4e8c\u6269\u5c55\u6587\u4ef6\u7cfb\u7edf(E2fs)\u4e0a\u7684\u7279\u6709\u5c5e\u6027\u9012\u5f52\u5730\u4fee\u6539\u5185\u5bb9\u4ecb\u7ecd\u4ee5\u53ca\u5176\u4e0b\u5185\u5bb9\u7684\u5c5e\u6027.\u8be6\u5c3d\u5730\u7ed9\u51fachattr\u7684\u8f93\u51fa\u4fe1\u606f\u5e76\u6253\u5370\u51fa\u7a0b\u5e8f\u7684\u7248\u672c.\u8bbe\u7f6e\u4e86`a\u5c5e\u6027\u7684\u6587\u4ef6\u53ea\u80fd\u5728\u6dfb\u52a0\u6a21\u5f0f\u4e0b\u6253\u5f00\u7528\u4e8e\u5199\u5165.\u8bbe\u7f6e\u4e86`c\u5c5e\u6027\u7684\u6587\u4ef6\u5728\u78c1\u76d8\u4e0a\u7531\u5185\u6838\u81ea\u52a8\u8fdb\u884c\u538b\u7f29\u5904\u7406.\u5230\u6587\u4ef6\u5b50\u7cfb\u7edf\u4e0a\u7684`sync\u6302\u8f7d\u9009\u9879\u6709\u76f8\u540c\u7684\u6548\u679c.conf#\u8bbe\u7f6e\u8be5\u6587\u4ef6\u4e0d\u80fd\u8fdb\u884c\u4efb\u4f55\u5f62\u52bf\u7684\u4fee\u6539\u663e\u793a\u6587\u4ef6\u5728Linux\u7b2c\u4e8c\u6269\u5c55\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u7279\u6709\u5c5e\u6027conf#\u8bbe\u7f6e\u8be5\u6587\u4ef6\u4e0d\u80fd\u8fdb\u884c\u4efb\u4f55\u5f62\u52bf\u7684\u4fee\u6539<\/p>\n","protected":false},"author":1,"featured_media":270366,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-270365","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\/270365","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=270365"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/270365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/270366"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=270365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=270365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=270365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}