There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar archive or you would like to speedup the process or you do not have GNU tar (which support x,z flags for compress the tar). In such case you can use one small trick which will save you some disk space and on the same time will speedup the process because or parallel run of the commands.
Instead of run:
tar czf file.tar.gz files_to_be_archived
you can run it on this way:
tar cf - files_to_be_archived|gzip -c >file.tar.gz
This will avoid creation of temporary intermediate file and run tar and gzip in parallel. Usage of dash (-) is good practice because in UNIX OS absence of name of file archive will send the output of command to real tape device.
You can find the original discussion in Unix StackExchange
Unix swing
Unix/Linux tips, tricks and interesting commands and ideas
Subscribe to:
Posts (Atom)
Compressed tar archive
There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...
-
To build firewall under AIX is sample, but as each host based firewall should be done careful 1. Prerequisites To start firewall in AIX yo...
-
There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...
-
4. Its time for some system administrator tasks. Oracle ASM need special mark of disks will work with 4.1. Because of some reason (i don...