zfore – Force gzip compressed files to add .gz suffix

The zfore command is used to force gzip compressed files to add the .gz suffix. This command is useful when you have gzip compressed files without the .gz suffix and you want to add it to the filename.


The syntax for using the zfore command is:

zfore [OPTION]... [FILE]...

where OPTION is an optional argument and FILE is the file(s) to be compressed.


  1. To add the .gz suffix to a single file:
zfore file.txt

This will create a new file named file.txt.gz in the same directory.

  1. To add the .gz suffix to multiple files:
zfore file1.txt file2.txt file3.txt

This will create new files named file1.txt.gz, file2.txt.gz, and file3.txt.gz in the same directory.

  1. To force overwrite an existing .gz file:
zfore -f file.txt.gz

This will overwrite the existing file.txt.gz with a new compressed file with the same name.


The following options are available for the zfore command:

Option Description
-f Force overwriting of an existing .gz file
-h Display help message and exit
-V Display version information and exit

Troubleshooting tips

  • If you receive an error message stating that the file is not a valid gzip file, ensure that the file is actually gzip compressed and does not have any other compression format.
  • If the compressed file already has the .gz suffix, the zfore command will not add another .gz suffix to the filename.


  • The zfore command is similar to the gzip command, but zfore only adds the .gz suffix to the filename without actually compressing the file.
  • The zfore command is not included in all Linux distributions by default, so you may need to install it separately.