tar command is very useful for file compression. The format of the command is like this:
tar cvzf [archive_name].tar.gz [what_to_compress]
You have the files abc.txt and def.txt and you want to compress them into an archive called
The command is:
tar cvzf archive.tar.gz abc.txt def.txt
To extract the files from the archive, you need to use:
tar xvf archive.tar.gz
note: you can omit the v in cvzf and xvf, since v just shows you the files being compressed or extracted from a compressed archive.