Basic Commands and Simple Shell Scripts -z This compresses the newly created tar file with gzip. It is also usable for decompression.
We may want to review that same option when decompressing:
[root@rhel-instance
]# cd tmp/[root@rhel-instance tmp]# rm -rf etc[root@rhel-instance tmp]# tar -xzf ../etc-backup.tar.gz[root@rhel-instance tmp]# lsetcAs you can see, it’s very easy to pack and compress files using tar and gzip. There are other available compression
methods with higher ratios, such as bzip2 or xz, that you may want to try, too. Now, let’s move onto combine all the commands that we have learned into a powerful way to automate – by creating shell scripts.
Share with your friends: