{"id":134600,"date":"2020-07-21T03:52:38","date_gmt":"2020-07-20T19:52:38","guid":{"rendered":"http:\/\/4563.org\/?p=134600"},"modified":"2020-07-21T03:52:38","modified_gmt":"2020-07-20T19:52:38","slug":"linux-tar-%e6%89%93%e5%8c%85%e8%a7%a3%e5%8c%85%e9%83%bd%e9%9c%80%e8%a6%81%e4%b8%a4%e5%80%8d%e7%a9%ba%e9%97%b4%ef%bc%8c%e6%9c%89%e4%bb%80%e4%b9%88%e5%8a%9e%e6%b3%95%e5%8f%af%e4%bb%a5%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=134600","title":{"rendered":"[ Linux ] tar \u6253\u5305\u89e3\u5305\u90fd\u9700\u8981\u4e24\u500d\u7a7a\u95f4\uff0c\u6709\u4ec0\u4e48\u529e\u6cd5\u53ef\u4ee5\u89e3\u51b3\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  [ Linux ] tar \u6253\u5305\u89e3\u5305\u90fd\u9700\u8981\u4e24\u500d\u7a7a\u95f4\uff0c\u6709\u4ec0\u4e48\u529e\u6cd5\u53ef\u4ee5\u89e3\u51b3\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mianhk <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6587\u4ef6\u6bd4\u8f83\u5c0f\u7684\u65f6\u5019\u8fd8\u6bd4\u8f83\u597d\u5904\u7406\uff0c\u4f46\u662f\u6587\u4ef6\u5927\u4e86\uff0c\u78c1\u76d8\u7a7a\u95f4\u53ef\u80fd\u5c31\u4e0d\u591f\u4e86\u3002<\/p>\n<p>\u5c31\u89e3 tar \u5305\u800c\u8a00\uff0c\u76ee\u524d\u770b\u5230\u7684\u6bd4\u8f83\u6d41\u884c\u7684\u529e\u6cd5\u662f\uff1a<\/p>\n<p>1.\u627e\u5230 tar \u4e2d\u7684\u4e00\u4e2a\u4e2a\u6587\u4ef6\uff0c\u89e3\u4e00\u4e2a\u5220\u4e00\u4e2a\u3002\u4f18\u70b9\u662f\u5728\u6587\u4ef6\u5939\u5927\u5c0f\u5dee\u4e0d\u591a\u65f6\u5019\uff0c\u5360\u7528\u7a7a\u95f4\u4f1a\u5c0f\u5f88\u591a\u3002\u7f3a\u70b9\u662f\uff0c\u6781\u6162<br \/> 2.\u8fdc\u7a0b\u89e3\u5305\uff0c\u7136\u540e rsync \u5230\u76ee\u6807\u673a\u5668\u3002\u95ee\u9898\u662f\u8fd8\u5f97\u4e13\u95e8\u641e\u4e00\u53f0\u673a\u5668\u3002\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>20<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2511553\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Osk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6362 7z \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511554\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ba1\u9053                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511555\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cev2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1.\u6253\u5305+\u538b\u7f29\u4e0d\u9700\u8981\u4e24\u500d\u7a7a\u95f4\uff1b<br \/>2.tar \u53ef\u76f4\u63a5\u6302\u8f7d\uff0c\u4e0d\u9700\u8981\u89e3\u5305\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511556\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dangyuluo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pipe                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511557\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/unix.stackexchange.com\/questions\/341458\/decompress-gzip-file-in-place<br \/>\u6309\u8fd9\u4e2a\u65b9\u6cd5\u89e3\u538b\u5e94\u8be5\u53ef\u4ee5\uff08\u6539 unzip \u4e3a tar xvf \u9644\u5e26\u538b\u7f29\u53c2\u6570\uff09<br \/>\u538b\u7f29\u5927\u6982\u4e5f\u53ef\u4ee5\uff0c\u4f46\u662f\u4e0d\u786e\u5b9a\u80fd\u4e0d\u80fd\u7528 shell \u5b9e\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511558\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : laminux29 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u6839\u672c\u5c31\u4e0d\u662f\u6280\u672f\u95ee\u9898\uff0c\u5efa\u8bae\u4e3b\u5b66\u4e00\u70b9\u670d\u52a1\u5668\u7ba1\u7406\u4ee5\u53ca\u8fd0\u7ef4\u77e5\u8bc6\u3002<\/p>\n<p>\u4f60\u8fd9\u4e2a\u95ee\u9898\u7c7b\u4f3c\u4e8e\uff0c\u5728\u516c\u5171\u573a\u6240\u5927\u5c0f\u4fbf\u600e\u6837\u624d\u80fd\u4e0d\u88ab\u6253\u3002<\/p>\n<p>\u7b54\u6848\u5e76\u4e0d\u662f\u627e\u51fa\u4e0d\u88ab\u6253\u7684\u529e\u6cd5\uff0c\u800c\u662f\u6839\u672c\u5c31\u4e0d\u80fd\u5728\u516c\u5171\u573a\u6240\u5927\u5c0f\u4fbf\u3002<\/p>\n<p>\u8fd8\u6709\u4e2a\u7c7b\u4f3c\u95ee\u9898\uff0ctcp \u600e\u6837\u624d\u80fd\u4e0d\u7c98\u5305\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511559\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : laqow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @laminux29 \u4e5f\u6709\u51e0\u5341\u4e2a gz \u6253\u5305\u6210\u4e00\u4e2a tar \u52a0\u8d77\u6765\u51e0\u5341 G \u7684\u573a\u5408\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511560\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lozzow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @laminux29 \u6ca1\u5fc5\u8981\u8fd9\u6837\u5427\uff0c\u6211\u8fd8\u662f\u76f8\u4fe1\u5f88\u591a\u670b\u53cb\u90fd\u4e0d\u77e5\u9053\u8fd9\u4e2a\u60c5\u51b5\u5427\uff0c\u5927\u5bb6\u4e0d\u4e00\u5b9a\u6709\u670b\u53cb\u4f60\u8fd9\u6837\u7684\u9ad8\u5ea6\uff0c\u6211\u53cd\u6b63\u8fd8\u662f\u633a\u671f\u5f85\u6709\u670b\u53cb\u80fd\u56de\u7b54\u4e00\u4e0b\u4e3b\u7684\u95ee\u9898\uff0c\u7136\u540e\u5b66\u4e60\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511561\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shakoon <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u53ef\u80fd\u8fd8\u6ca1\u6709\u641e\u660e\u767d\uff0ctar \u662f\u6ca1\u6709\u538b\u7f29\u7684\uff0c\u53ea\u662f\u7269\u7406\u4e0a\u628a\u6587\u4ef6\u653e\u5230\u4e00\u8d77\uff0c\u548c zip\/rar\/7z\/gz \u4e4b\u7c7b\u7684\u5b8c\u5168\u662f\u4e24\u56de\u4e8b\uff0c\u6240\u4ee5\u624d\u4f1a\u7528\u5230\u4f60\u8bf4\u7684\u201c\u4e24\u500d\u201d\u7a7a\u95f4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511562\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : linjinbao66 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u53ef\u4ee5\u60f3\u5230\u7684\u65b9\u6cd5\uff0c\u5148\u521b\u5efa\u4e00\u4e2a tar\uff0c\u5305\u518d\u5f80\u91cc\u9762\u6dfb\u52a0\uff0c\u6dfb\u52a0\u4e00\u4e2a\u5220\u9664\u4e00\u4e2a\uff0c\u7ba1\u9053\u7b26\u914d\u5408\u4f7f\u7528\uff0c\u6dfb\u52a0\u4e00\u4e2a\u5220\u9664\u4e00\u4e2a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511563\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : linjinbao66 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`shell<br \/>tar -cvf tmp.tar b.txt<br \/>for file in `find 2020`<br \/>do<br \/> echo $file<br \/> tar -uvf tmp.tar $file<br \/> rm -rf $file<br \/>done<br \/>&#8220;`<\/p>\n<p>## 1. \u521b\u5efa tmp.tar \u6587\u4ef6<br \/>## 2. \u904d\u5386\u9700\u8981\u6253\u5305\u7684\u6587\u4ef6\uff0c\u8ffd\u52a0\u5230 tar \u5305\u5185<br \/>## 3. \u5220\u9664\u5df2\u7ecf\u8ffd\u52a0\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511564\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lolizeppelin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u770b\u4e0b coreutils \u91cc split \u7684\u7684\u4ee3\u7801<br \/>\u5982\u679c\u4e5f\u662f\u590d\u5236, \u90a3\u5e94\u8be5\u6ca1\u6709\u4e00\u822c\u6027\u7684\u505a\u6cd5\u80fd\u505a\u5230                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511565\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : mianhk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Osk #1 \u5df2\u7ecf\u7528\u4e86\u6ca1\u529e\u6cd5\u6539\u4e86<br \/>@Jirajine #2 \u5355\u7eaf\u53ea\u662f\u89e3 tar \u5305\u7684\u8bdd\uff0c\u89e3\u5b8c\u524d\u540e\uff0c\u539f tar \u5305\u548c\u89e3\u5f00\u7684\u6587\u4ef6\u90fd\u5728\uff0c\u80af\u5b9a\u8fd8\u662f\u4e24\u500d\u7a7a\u95f4\u4e86\u3002\u3002<br \/>@cev2 #3 1.\u53ea\u6253\u5305\u548c\u89e3\u5305\u7684\u8bdd\u662f\u4f1a\u7684\uff0c\u539f\u6587\u4ef6\u548c\u65b0\u6587\u4ef6\u5939 \u52a0\u5728\u4e00\u8d77\u30022.\u76f4\u63a5\u6302\u8f7d\u60f3\u5199\u6587\u4ef6\u8fdb tar \u5305\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u5417\uff0c\u662f\u4e0d\u662f\u4e5f\u6162\u4e00\u4e9b<br \/>@codehz #5 \u7c97\u7565\u770b\u4e86\u4e00\u4e0b\uff0c\u8fd9\u4e2a\u56de\u7b54\u597d\u50cf\u672c\u8eab\u5c31\u4e0d\u5efa\u8bae\u7528\u3002\u3002<\/p>\n<p>@laminux29 #6 \u73b0\u5728\u95ee\u9898\u662f\uff0c\u6211\u6709\u4e2a\u670b\u53cb\u5df2\u7ecf\u516c\u5171\u573a\u5408\u5927\u5c0f\u4fbf\u4e86\uff0c\u53ef\u4ee5\u600e\u4e48\u5904\u7406\u8ba9\u4ed6\u4e0d\u88ab\u6253\u5417<br \/>@shakoon #9 \u5c31\u662f\u77e5\u9053\u4e86\u8fd9\u4e00\u70b9\uff0c\u6240\u4ee5\u624d\u60f3\u8981\u6709\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u529e\u6cd5\uff0c\u6700\u524d\u9762\u8bf4\u5230\u7684\u4e24\u4e2a\u662f\u53ef\u4ee5\u4fdd\u8bc1\u4e00\u500d\u7a7a\u95f4\u7684\uff0c\u4f46\u662f\u90fd\u8fd8\u662f\u6709\u52a3\u52bf<br \/>@linjinbao66 #10 \u540c\u7b2c\u4e00\u79cd\u65b9\u5f0f\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u8017\u65f6\u592a\u957f\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511566\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Latin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             tar -czvf <br \/>-z \u6dfb\u52a0 gzip \u538b\u7f29                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511567\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mianhk \u6bd4\u5982\u4f60\u7684 tarball \u662f\u4ece\u7f51\u7edc\u4e0b\u8f7d\uff0c<br \/>wget -O &#8211; xxx.tar.gz | tar xz -f &#8211;<br \/>\u5c31\u53ef\u4ee5\u53ea\u5360\u7528\u4e00\u4efd\u7a7a\u95f4\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511568\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : mianhk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Jirajine #15 \u4e0d\u662f\u7f51\u7edc\u4e0b\u8f7d\u7684\u3002\u3002<br \/>@lolizeppelin #12 \u53ef\u80fd\u53ea\u6709\u5f00\u59cb\u8bf4\u7684\u7b2c\u4e8c\u79cd\u7b97\u662f\u6bd4\u8f83\u597d\u7684\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511569\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ETiV <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u300c\u78c1\u76d8\u7a7a\u95f4\u53ef\u80fd\u5c31\u4e0d\u591f\u4e86\u300d<br \/>\u4e0d\u80fd\u52a0\u5417\uff0c\u6216\u8005 NFS \u6302\u8f7d\u4e00\u4e2a\u8fdc\u7a0b\u7684\u78c1\u76d8<\/p>\n<p>https:\/\/en.wikipedia.org\/wiki\/Tar_(computing)<\/p>\n<p>tar &#8230; The name is derived from &#8220;tape archive&#8221;, as it was originally developed to write data to sequential I\/O devices with no file system of their own.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511570\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iamwho <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u548c linux \u6709\u4ec0\u4e48\u5173\u7cfb\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511571\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : byzf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u6709\u4e2a 100G \u7684\u6587\u4ef6\u5939, \u62f7\u8d1d\u4e86\u4e00\u4efd, \u662f\u4e0d\u662f\u5fc5\u987b\u5360\u7528 200G \u786c\u76d8?<\/p>\n<p>\u7b54: \u538b\u7f29<\/p>\n<p>\u6211\u4e0d\u60f3\u7528\u538b\u7f29<\/p>\n<p>\u7b54: \u90a3\u4f60\u5728\u95ee\u5565                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2511572\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chzhx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bb0\u5f97\u5f53\u65f6 aix \u4e0b\u7684 tar \u6ca1\u6709-z \u53c2\u6570\uff0c\u6211\u662f\u7528\u7ba1\u9053\u6253\u5305\u548c\u89e3\u538b\u7684\u3002<br \/>tar -cvf &#8211; xxxx | gzip &gt;xxxx.tar.gz<br \/>gzip -cd xxxx.tar.gz | tar -xvf &#8211;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>[ Linux ] tar \u6253\u5305\u89e3&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134600"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134600"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134600\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134600"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}