J
Jarret W. Buse
Guest
Applications 24 - Compression with tar
In the previous article, Applications 23 - Compression with gzip, the basis that small files can help speed up a system. File compression is making files smaller than they are so they can read/written faster and transferred over the network/Internet quicker.
There is also the ability to write more compressed files on portable media such as USB, CD/DVD, etc. The tar compression method is another typical method used on Linux systems.
The basic syntax for using tar is:
tar <operation> [option] [folder/file]
The Operation specifies what the program will do to the specified file. The Operations and their examples are:
Now that the Operations are covered, we can look into the common Options and some examples.
It is best to try the Operations and Options to understand how they work as well as working together with other Options. Of course, you may wonder about the command-line tar program and not just use a Graphical User Interface (GUI) compression program. Always be prepared in the case you are on a system with no compression program with a GUI. As well as not being able to access the Internet to download a GUI based compression program. There are a few questions on the Linux+ Certification exam about tar (as well as gzip).
In the next article, I will cover the non-common options for tar.
In the previous article, Applications 23 - Compression with gzip, the basis that small files can help speed up a system. File compression is making files smaller than they are so they can read/written faster and transferred over the network/Internet quicker.
There is also the ability to write more compressed files on portable media such as USB, CD/DVD, etc. The tar compression method is another typical method used on Linux systems.
The basic syntax for using tar is:
tar <operation> [option] [folder/file]
The Operation specifies what the program will do to the specified file. The Operations and their examples are:
- -A, (--catenate, --concatenate) - append tar files to an existing archive
- -c, (--create) – create a new tar file
- -d, (--diff, --compare) – find differences between system files and those in a tar file
- -r, (--append) – append files to the end of an archive
- -t, (--list) – list contents of the tar file
- -u, (--update) – append newer files into an existing archive
- -x, (--extract, --get) – extract files from tar archive
- --delete - delete from the tar
Now that the Operations are covered, we can look into the common Options and some examples.
- -C, (--directory DIR)
- -f, (--file F)
- -j, (--bzip2)
- -p, (--preserve-permissions)
- -v, (--verbose)
- -z, (--gzip)
It is best to try the Operations and Options to understand how they work as well as working together with other Options. Of course, you may wonder about the command-line tar program and not just use a Graphical User Interface (GUI) compression program. Always be prepared in the case you are on a system with no compression program with a GUI. As well as not being able to access the Internet to download a GUI based compression program. There are a few questions on the Linux+ Certification exam about tar (as well as gzip).
In the next article, I will cover the non-common options for tar.