Single line command to archive a certain amount of folders
- by EarthMind
I'm looking for a single line command that archives 5 folders into .tar files (no gzip/bzip needed) in a certain directory and deletes the folders after a successful compression. It has to use the original folder name as file name for the archive too.
So far I've used the current command, which only does one directory per time:
tar -c directory > directory.tar && rm -rf directory
Thanks in advance.