简体   繁体   English

如何对目录中的所有文件进行tar压缩并将该tar移至另一个目录

[英]how to tar all files in a directory and move that tar to another directory

So I have 2 directors A and B. I want to tar all the files in A and have the .tar file be sent to directory B. How can i do this? 因此,我有2个导演A和B。我想压缩A中的所有文件,并将.tar文件发送到目录B。我该怎么做?

I have tried 我努力了

sudo tar -C /home/mine/A/  -cvf home/mine/B/test.tar
tar: Cowardly refusing to create an empty archive
tar -cvf /home/mine/B/test.tar /home/mine/A/

对我来说很好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 tar目录中的文件并将存档放在另一个目录中 - tar the files in a directory and put the archive in another directory 如何将多个文件(在另一个文件中列出)tar到不同目录中它们自己的tar中? - How do I tar multiple files (which are listed in another file) to their own separate tar in a different directory? 如何隐藏tar归档文件中的目录名? - how to suppress directory names in tar archived files? Tar另一个目录的子目录下的文件列表 - Tar a list of files under a sub directory of another directory 将所有 .tar 和 .tar.bz2 文件系统从所有子目录复制到另一个目录中 - copying all the .tar and .tar.bz2 file systems from all the sub-directories into another directory tar:添加当前目录下的所有文件和目录 INCLUDING.svn 等 - tar: add all files and directories in current directory INCLUDING .svn and so on 如何压缩目录但排除文件 - How to tar a directory but exlude a file 留在另一个文件夹中,如何从另一个目录中压缩特定文件? - Staying in another folder, how can i tar specific files from another directory? 除了某些文件夹中的文件外,我如何将其所有文件包含在文件夹或目录中? - How do I tar a folder or directory with all of it's files except leave out files from certain folders? 如何解压缩内部包含 tar.gz 文件的 tar 文件目录? - How to untar a directory of tar files having tar.gz files internally in it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM