tar命令
高级用法
tar cf - /tmp/foo | kubectl exec -i -n <some-namespace> <some-pod> -- tar xf - -C /tmp/bar
命令解释:
管道前 tar cf - /tmp/foo 是将 /tmp/foo 目录下打包输出到 标准输出 其中的 - 表示:标准输出
-- 表示:前一个命令的参数截止,后面不再是该命令的参数
-- 之后的 tar xf - -C /tmp/bar 是将标准输入的结果解压到 /data 下 其中的 - 表示:标准输入
posted on 2022-05-27 02:04 hopeless-dream 阅读(79) 评论(0) 编辑 收藏 举报