Saturday, June 20, 2015

Solaris gzip and tar one-liners

As the Solaris tar do not handle compression you can use following one-liners to get the files archived and compress in one line:


1. Archive and compress folder:

tar cf - folder_name | gzip -c > filename.tar.gz

2. Decompress and unpack:

gzcat filename.tar.gz | tar -xpf -