GZip every file separately

Tonio picture Tonio · Nov 24, 2009 · Viewed 34.9k times · Source

How can we GZip every file separately?

I don't want to have all of the files in a big tar.

Answer

Courtney Faulkner picture Courtney Faulkner · Nov 24, 2009

You can use gzip *


Note:

  • This will zip each file individually and DELETE the original.
  • Use -k (--keep) option to keep the original files.
  • This may not work if you have a huge number of files due to limits of the shell
  • To run gzip in parallel see @MarkSetchell's answer below.