Linux tar\u4ee3\u8868\u78c1\u5e26\u5b58\u6863\u3002\u5b83\u7528\u4e8e\u5c06\u8bb8\u591a\u6587\u4ef6\u6536\u96c6\u5230\u4e00\u4e2a\u5b58\u6863\u6587\u4ef6\u4e2d\u3002Tar\u662f\u521b\u5efa\u538b\u7f29\u5f52\u6863\u6587\u4ef6\u6700\u5e7f\u6cdb\u4f7f\u7528\u7684\u547d\u4ee4\u3002<\/p>\n
\u8ba9\u6211\u4eec\u4ece\u5982\u4f55\u4e3a\u7279\u5b9a\u76ee\u5f55\u521b\u5efa\u5b58\u6863\u6587\u4ef6\u5f00\u59cb\uff1a<\/p>\n
tar -cvf my-archive.tar \/path\/to\/directory \r\n<\/pre>\n\u8be5\u547d\u4ee4\u5c06\u5bfc\u81f4\u4e00\u4e2a\u540d\u4e3amy-archive.tar\u7684\u5b58\u6863\u6587\u4ef6\uff0ctar\u6587\u4ef6\uff0c\u5b83\u5305\u542b\u5728\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u4e2d\u521b\u5efa\u7684\/path\/to\/\u76ee\u5f55\u7684\u6240\u6709\u6587\u4ef6\u3002<\/p>\n
\u521b\u5efa\u5b58\u6863\u6587\u4ef6\u662f\u7b2c\u4e00\u6b65\u3002\u7b2c\u4e8c\u90e8\u5206\u5305\u62ec\u89e3\u538b\u7f29\u5b58\u6863\u6587\u4ef6\uff0c\u56e0\u4e3a\u5728\u67d0\u4e9b\u65f6\u5019\u6211\u4eec\u60f3\u4f7f\u7528tar\u6587\u4ef6\u4e2d\u7684\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u5c06\u6587\u4ef6\u89e3\u538b\u7f29\u5230\u7279\u5b9a\u76ee\u5f55\uff1a<\/p>\n
tar -xvf my-archive.tar -C \/ home \/ myfolder \/ \r\nalias\r\n<\/pre>\n\u6bcf\u4e2a\u4eba\u90fd\u4f7f\u7528\u4e00\u4e9b\u592a\u957f\u6216\u592a\u590d\u6742\u800c\u65e0\u6cd5\u5b8c\u5168\u8bb0\u4f4f\u7684\u547d\u4ee4\u3002\u5e78\u8fd0\u7684\u662f\uff0c\u60a8\u53ef\u4ee5\u4e3a\u8be5\u547d\u4ee4\u521b\u5efa\u4e00\u4e2aalias\uff0c\u56e0\u6b64\u60a8\u4e0d\u5fc5\u8bb0\u4f4f\u6574\u4e2a\u547d\u4ee4\u3002<\/p>\n
alias short-command=\"your custom and very long command here\" \r\n<\/pre>\n\u5c3d\u7ba1\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u521b\u5efaalias\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff1a\u6b64alias\u662f\u4e34\u65f6\u7684\u3002\u5982\u679c\u4ee5\u6b64\u65b9\u5f0f\u521b\u5efa\uff0c\u5219\u8be5alias\u4ec5\u53ef\u7528\u4e8e\u5f53\u524d\u7684\u7ec8\u7aef\u4f1a\u8bdd\u3002<\/p>\n
\u8981\u5728\u4f1a\u8bdd\u4e4b\u95f4\u4fdd\u7559alias\uff0c\u53ef\u4ee5\u5c06\u5176\u4fdd\u5b58\u5728\u7528\u6237\u7684Shell\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002\u5982\u679c\u60a8\u5206\u522b\u4f7f\u7528Bash\u6216ZSH\uff0c\u5219\u6b64\u914d\u7f6e\u6587\u4ef6\u53ef\u80fd\u4f4d\u4e8e\u301c\/ .bashrc\u6216\u301c\/ .zshrc\u4e2d\u3002<\/p>\n
\u6280\u5de71\uff1a\u76f4\u63a5\u8f93\u51fa<\/strong><\/span><\/div>\n\u5c4f\u5e55\u662f\u6807\u51c6\u8f93\u51fa\u8bbe\u5907\u3002\u4f46\u6709\u65f6\u60a8\u4e0d\u60f3\u5728\u5c4f\u5e55\u4e0a\u8f93\u51fa\u6240\u6709\u5185\u5bb9\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u5e0c\u671b\u5c06\u67d0\u4e9b\u547d\u4ee4\u7684\u7ed3\u679c\u8f93\u51fa\u5230\u6587\u4ef6\u4e2d\u3002<\/p>\n
\u4f8b\u5982\uff0c\u7528\u4e8e\u65e5\u5fd7\u8bb0\u5f55\u7684\u76ee\u7684\u3002\u8981\u91cd\u5b9a\u5411\u8f93\u51fa\uff0c\u53ef\u4ee5\u4f7f\u7528>\u3002\u5728\u4ee5\u4e0b\u547d\u4ee4\u4e2d\uff0cls -al\u7684\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6587\u4ef6myfile\u800c\u4e0d\u662f\u5c4f\u5e55\u3002<\/p>\n
ls -al> myfile \r\n<\/pre>\n\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u6211\u4f7f\u7528\u4e86ls\uff0c\u4f46\u5b9e\u9645\u4e0a\u5b83\u53ef\u4ee5\u662f\u4efb\u4f55\u5177\u6709\u67d0\u4e9b\u8f93\u51fa\u7684\u547d\u4ee4\u3002\u4e3a\u4e86\u786e\u8ba4\u8fd9\u662f\u53ef\u884c\u7684\uff0c\u60a8\u53ef\u4ee5\u68c0\u67e5myfile\u6587\u4ef6\u3002<\/p>\n
\u6280\u5de72\uff1a\u5408\u5e76\u547d\u4ee4<\/strong><\/span><\/div>\n\u4e00\u6b21\u53ef\u4ee5\u8fd0\u884c\u4e24\u4e2a\u6216\u591a\u4e2a\u547d\u4ee4\u3002\u5206\u53f7(;)\u8fd0\u7b97\u7b26\u5141\u8bb8\u60a8\u6267\u884c\u6b64\u64cd\u4f5c\u3002\u60a8\u53ef\u4ee5\u8fde\u7eed\u6267\u884c\u591a\u4e2a\u547d\u4ee4\uff0c\u800c\u4e0d\u7ba1\u6bcf\u4e2a\u5148\u524d\u7684\u547d\u4ee4\u662f\u5426\u6210\u529f\u3002<\/p>\n
ls -al; pwd; \r\n<\/pre>\n\u5982\u679c\u8981\u4ec5\u5728\u7b2c\u4e00\u4e2a\u547d\u4ee4\u6210\u529f\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u7b2c\u4e8c\u4e2a\u547d\u4ee4\uff0c\u8bf7\u4f7f\u7528\u903b\u8f91\u548c\u64cd\u4f5c\u7b26(\u5373&&)\u5206\u9694\u547d\u4ee4\u3002<\/p>\n
mkdir images && cd images \r\n<\/pre>\n\u5982\u679c\u6211\u4eec\u8bbe\u6cd5\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\uff0c\u6211\u4eec\u53ea\u60f3CD\u5230images\u6587\u4ef6\u5939\u3002<\/p>\n
\u6709\u65f6\u60a8\u53ef\u80fd\u53ea\u60f3\u5728\u7b2c\u4e00\u4e2a\u547d\u4ee4\u4e0d\u6210\u529f\u7684\u60c5\u51b5\u4e0b\u6267\u884c\u7b2c\u4e8c\u4e2a\u547d\u4ee4\u3002\u4e3a\u6b64\uff0c\u6211\u4eec\u4f7f\u7528\u903b\u8f91OR\u64cd\u4f5c\u7b26\uff0c\u5373||\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4e0d\u4f1a\u4ecb\u7ecdls\uff0crm\u548ccd\u7b49\u57fa\u672c\u547d\u4ee4\u3002\u770b\u5230\u8fd9\u4e9b\u547d\u4ee4\u5e94\u8be5\u4e0d\u4f1a\u4ee4\u60a8\u611f\u5230\u9707\u60ca\u3002\u60a8\u751a\u81f3\u53ef\u80fd\u5bf9\u5b83\u4eec\u975e\u5e38\u719f\u6089\uff0c […]<\/p>\n","protected":false},"author":1898,"featured_media":171623,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[543],"class_list":["post-171606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-ssh-keygen"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/171606","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\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=171606"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/171606\/revisions"}],"predecessor-version":[{"id":171641,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/171606\/revisions\/171641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/171623"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=171606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=171606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=171606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}