{"id":288,"date":"2023-02-24T21:52:58","date_gmt":"2023-02-24T13:52:58","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=288"},"modified":"2023-04-30T15:12:26","modified_gmt":"2023-04-30T07:12:26","slug":"exclude-option-of-tar-command-under-linux-to-exclude-specified-files-or-directories","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/24\/exclude-option-of-tar-command-under-linux-to-exclude-specified-files-or-directories\/","title":{"rendered":"Linux\u4e0btar\u547d\u4ee4exclude\u9009\u9879\u6392\u9664\u6307\u5b9a\u6587\u4ef6\u6216\u76ee\u5f55"},"content":{"rendered":"<h2>\u6253\u5305\u6240\u6709<\/h2>\n<pre><code>tar -zcf test.tar.gz test<\/code><\/pre>\n<p><!-- more --><\/p>\n<h2>\u6392\u9664\u540e\u7f00<\/h2>\n<pre><code>tar -zcf test.tar.gz test --exclude *.jpg<\/code><\/pre>\n<p>\u6392\u9664jpg\u540e\u7f00\u7684\u6587\u4ef6\uff0c\u5305\u62ec\u5b50\u76ee\u5f55\uff01<\/p>\n<h2>\u6392\u9664\u591a\u4e2a\u540e\u7f00<\/h2>\n<pre><code>tar -zcf test.tar.gz test --exclude *.txt --exclude *.jpg<\/code><\/pre>\n<h2>\u6392\u9664\u6307\u5b9a\u6587\u4ef6<\/h2>\n<pre><code>tar -zcf test.tar.gz test --exclude a.txt<\/code><\/pre>\n<h2>\u6392\u9664\u6307\u5b9a\u76ee\u5f55<\/h2>\n<pre><code>tar -zcf test.tar.gz test --exclude subdir<\/code><\/pre>\n<h2>\u7ec4\u5408\u6392\u9664<\/h2>\n<pre><code>tar -zcf test.tar.gz test --exclude subdir --exclude a.log --exclude *.jpg<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6253\u5305\u6240\u6709 tar -zcf test.tar.gz test \u6392\u9664\u540e\u7f00 tar -zcf test.tar.g [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-devops-base"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}