Archive File in Linux


Last Blog Review →
In the last blog we understood, how to send the file from local machine to EC2 and also send the file from EC2 to local machine. Only the requirement is that the scp can be used only on local machine as the local machine must have the private key file and the public DNS of the EC2 machine to allow the secure copy.
What is archiving ?
Archiving is the process of combining multiple files and directories (same or different size) into 1 file. Archive is highly useful for backup and compression size of data in Linux.
What is Tar ?
The Linux “tar” stands for tape archive, which is used by large number of Linux/Unix administrators to compress size or drives backup. For creating archive tar use some compression algorithm such as gzip, bz2, xz….
Tar command syntax
tar <options> <archive-file named> <files to be archived>
Explanation of above syntax
<options> = you can use this to modify the command
<archive-file named> = name of file which will be archived
<files to be archived> = files and directories you want to archive
Commonly used option
c = for creating
x = for extracting
v = for verbose
f = for forcefully
t = for test
z = for gzip
j = for bz2
J = for xz
C = for specific destination
Conclusion →
In the blog we understood the basics of archiving what it does and how archiving is done in Linux using Tar command. Tar command syntax and it’s option which is used to modify the tar command. Later on in coming blogs we will see the use of tar command to archiving files and directories and extracting it.
Subscribe to my newsletter
Read articles from Mihir Suratwala directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Mihir Suratwala
Mihir Suratwala
Hi, How are you !! Hope you doing good.... I got introduced to Cloud initially. As I went ahead learning what is cloud and how it works, then got to know a field which is DevOps that makes Cloud model more effective. So, as I started working & got good experience on AWS. I have been learning the DevOps tool and technologies on how to use it with the Cloud, which will give me good understanding on how Cloud and DevOps go hand in hand to deploy my applications.