Grouping files in an archive doesn't save disk space on its own. We would need to compress an archive to save disk space. Numerous compression methods are available for us to use on Linux. However, we are only going to cover the three most popular compression methods.
The most popular compression method on Linux is arguably gzip, and the upside is that it's really fast. You can compress an archive file with gzip by using the -z option with the tar command as follows:
tar -czf compressed_archive archive_name
So to compress the scripts.tar archive into a gzip-compressed archive named scripts.tar.gz, you first need to change to the /root/backup directory and then run the following command:
root@ubuntu-linux:~/backup# tar -czf scripts.tar.gz scripts.tar
Now if you list the contents of the backup directory, you will see the newly created gzip-compressed archive scripts.tar.gz:
root@ubuntu-linux:~/backup# ls
scripts.tar scripts.tar.gz
The magic happened by using...