• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All
  • About
Linux-Ubuntu | gzip/gunzip -- compression/decompression
  1. Examples

  1. Examples
    • Compressing a file:

      This will compress the file "file1" and rename it to "file1.gz":
      $ touch file1
      $ ls -al
      -rw-r--r--  1 mtitek  mtitek  5632  3 Feb 21:01 file1
      $ gzip file1
      $ ls -al
      -rw-r--r--  1 mtitek  mtitek  242  3 Feb 21:01 file1.gz

    • Decompressing a file:

      • This will decompress the file "file1.gz" and rename it to "file1":
        $ gzip -d file1.gz
        $ ls -al
        -rw-r--r--  1 mtitek  mtitek  5632  3 Feb 21:01 file1

    • Decompressing a file (gunzip):

      • You can use gunzip to decompress the file "file1.gz" and rename it to "file1":
        $ gunzip file1.gz
        $ ls -al
        -rw-r--r--  1 mtitek  mtitek  5632  3 Feb 21:01 file1
© 2025  mtitek