Wednesday, May 16, 2012

Using tar to archive and compress a file or directory

Tar is one of my main tools to archive and compress file. It cannot be any easier

To create,compress and archive a new file, you can just simply use the command
$ tar cvzf foo.tgz *.c *.out
where c = create, v = verbose, z = compress, f = specifies the file name 

To archive a directory testdir, the
$ tar cvzf testdir.tgz testdir

No comments: