compress command is rarely used any more, and has largely been replaced by the Unix/Linux
bzip2 commands. However, on some Unix systems the
compress command is still used, so for them, here are a few examples of how to use it.
Unix compress command examples
The following command will compress the file named foo.tar into a new file named foo.tar.Z:
This command compresses the file named foo.tar, and replaces it will a file named foo.tar.Z. (Very important note: Your original foo.tar file will no longer exist.)
You can also use the
-v argument to get more output information during the file compression process, like this:
compress -v foo.tar
This compress command works just like the previous example, but gives more verbose output during the compression process. This is useful if you like to see the compression ratio you're getting with this utility.
Related Linux file compression commands
As mentioned above, the compress command has largely been replaced by the Unix/Linux gzip and bzip2 commands. I don't have any bzip2 command examples out here yet, as I always use the gzip command, so here are some gzip tutorials:
As you can see from the names of those tutorials, the gzip command has a lot of support with other Linux system commands.