Monday 30 September 2013

How to compress on the fly with maximum compression (Linux)

How to compress on the fly with maximum compression

for example

# tar cvf - /etc | gzip -c -9 > etc.tar.gz

Explain what the command above is doing.

TAR - Command to pack files and directories into a single package.
CVF are flags passed to the tar command to: Create, Verbose, File
/ETC is the folder to be tarred-up
| (Pipe) symbol to pass result to another command
GZIP is a compressing tool
-C flag to compress
-9 is a flag to use maximum compression
> this symbol is used to redirect output to a file, in this case "etc.tar.gz"

I hope this will be helpful to you and the explanation makes sense.

by Renato de Oliveira

No comments:

Post a Comment