How to tar a complete folder

tarball Hi there, this is the very first post on this blog and I’m gonna start out with an easy one 🙂 How to TAR a complete folder under the command line on a Linux system like Ubuntu. Lets say you wanna tar the folder “stuff” and put the tar file in your /backup folder. The command would look something like this:

tar  -czvf /backup/stuff.tar.gz <path>/stuff

That’s it, but what does it all really mean? Lets break it down

-c Create, very much needed when creating a new compressed file
-z To compress it you need to specify what method to be used. This one means we want to GZip the file. Instead of -z you could use -j witch would compress the file even more (using bzip2) but would take longer time of course. Anyway, without it you won’t compress anything, only archive the files into one place.
-v Verbose, this lets you see what tar is doing but is not necessary to compress the folder
-f File, means that what ever comes after this command is the path and name of the new compressed file

Cheers, /jima

One thought on “How to tar a complete folder”

Leave a Reply

Your email address will not be published. Required fields are marked *