I have below files in a directory.
file001
file002
.
.
file009
I need to compress them into one and remove original/source files (file001 .. file009
) so I can free up some disk space.
This is what I did: Archived all files into one using below command
tar -cvf file00.tar file00*
Then compressed the archived file using below command
xz file00.tar
previously I had archived and compressed using single command
tar -cJvf file00.tar.xz file00*
xz
has done a fine job, compressed 10GB file into less than 400MB but I have several problems with these methods:
- Old/source files are not removed
- xz takes huge time
My question is, is there any way I can archive and compress multiple files into one using single command that'll also remove source files? Is there any other compression tool that's efficient as xz but works faster?
I've seen in some other sites that I can use multiple cores/threads to boost xz process but haven't tried myself.
Thanks in advance.