Tar is a tool that's used for managing compressed archive files. The term “tar” stands for “tape archive”. It got its name because large number of Linux/UNIX system admins use this tool for backing up data with tape drives.
It's not only system admins that use tar. A large number of system components are also dependent on tar. For example, in the case of Arch Linux or any Arch-based distro, pacman is the default package manager. The functionality of pacman is extremely dependent on tar. Learn more about pacman.
For archiving, tar offers good and consistent compression ratio. However, the result is largely dependent on the file(s) and compression algorithm used.
With all these features packed, tar is something that's worth spending your weekend to master. Just kidding… it's actually so simple that after following this guide, you'll almost feel like a master. Without further ado, let's get started!
Tar usage
For using tar, we need some demo files, right? I've created an original demo file containing random data with the help of dd. All the others are simply clones of it.
dd if=/dev/urandom of=testFile bs=2MB count=1
Tar location
Before using tar, let's check out where it's located. Run the following command.
which tar
As the output says, whenever running “tar” command, it'll load the tool from “/usr/bin/tar”.
Archive file
For packing file(s) into archive, tar uses the following structure.
Linia de comandă nu este doar cel mai mare aliat al tău când folosești Linux - poate fi și sursa de divertisment, deoarece poți să o folosești pentru ...
If you like to play games on Linux with a gamepad instead of a typical keyboard and mouse input system, there are some useful apps for you. Many PC ga...
Dacă vă place să jucați jocuri pe Linux, este posibil să fi folosit aplicații și utilitare precum Wine, Lutris și OBS Studio pentru a îmbunătăți exper...