How To Install Tar File
tar is a widely used command-line based utility for combining a bunch of files and/or directories into 1 annal file, ordinarily known as a tarball for backup or distributions purposes. The tar command is used to create, maintain, change, or extract tar archives.
Read Also: five Best Command Line Archive Tools for Linux
Notation that tar does not shrink annal files by default, but, it tin can compress the resulting archive using (or filter it through) well-known data pinch programs such equally gzip, bzip2, or xz if you supply the -z
, -j
, or -J
flags.
Installing tar in CentOS, RHEL, and Fedora
The tar packet comes pre-installed in most if not all Linux distributions by default. Only if it is not installed on your system, run the following control to install it.
# yum install tar
Once you have tar installed on your arrangement, yous can employ information technology equally follows. This example shows how to create an uncompressed archive file of a directory called test_app
within the working directory.
# tar -cvf test_app.tar test_app/
In the above command, the tar flags used are -c
which creates a new .tar
annal file, -5
enables verbose manner to show the .tar
file creation progress, and -f
which specifies the file name blazon of the archive file (test_app.tar
in this example).
To compress the resulting archive file using gzip or bzip2, supply the -z
or -j
flag as follows. Note that a compressed tarball tin can besides end with the .tgz
extension.
# tar -cvzf test_app.tar.gz test_app/ OR # tar -cvzf test_app.tgz test_app/ OR # tar -cvjf test_app.tar.bz2 test_app/
To list the contents of a tarball (archived file), use the -t
flag as follows.
# tar -ztf test_app.tar.gz OR # tar -ztvf test_app.tar.gz #shows more details
To extract (or untar) an annal file, use the -x
switch every bit shown.
# tar -xvf test_app.tar OR # tar -xvf test_app.tar.gz
For more usage examples, meet our following articles:
- 18 Tar Command Examples in Linux
- How to Separate Large 'tar' Archive into Multiple Files of Certain Size
- How to Shrink Files Faster with Pigz Tool in Linux
- How to Compress and Decompress a .bz2 File in Linux
- 10 7zip (File Archive) Command Examples in Linux
That's all for now! In this article, we take shown how to install tar in CentOS, RHEL & Fedora and as well showed some basic tar usage commands. If you have whatsoever queries, share it with the states via the feedback class below.
If Y'all Appreciate What Nosotros Do Hither On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for whatsoever kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or scan the thousands of published articles available FREELY to all.
If you similar what yous are reading, delight consider buying us a coffee ( or 2 ) equally a token of appreciation.
We are thankful for your never ending back up.
Source: https://www.tecmint.com/install-tar-in-centos-rhel-and-fedora/
Posted by: rodriguezyeassuileat.blogspot.com
0 Response to "How To Install Tar File"
Post a Comment