Correct way of using the --remove-files option with TAR
Since the -f
argument is telling tar
you are going to speficy the file name of the archive you are acting on, I would keep the archive name right after that argument. The list of files and directories to include in the archive should come last. You can specify --remove-files
before your other arguments like this:
tar --remove-files -cvfj archive.tar.bz2 archive/