tar command in linux to create and extract archive files | Pro Tech guides

tar command in linux to create and extract archive files

tar command in linux allows you to Create, Maintain, Modify and Extract an archive files. By creating a tar file you can save some Disk space.

tar command in linux to create and extract | tar, zip, tar.xz files in your linux terminal

tar command in linux to create, manage and extract archive file
tar command in linux

Hello guys, Today I'm going to show you how you can use the "tar" command in Linux.

"tar" command is used to Create, Maintain, Modify and extract files. Which are archived in the "tar" format.

"tar" stands for Tape Archive.

It's an archiving file format just like "zip file".

Let's see how you can use "tar" command,

Creating a tar file (Compressed file)

create a tar file / compressed file using tar command
create a tar file

$tar -cvf [name of tar File.tar] [orignal fileName]
To create a tar file you need to use two Flags. They are,

  • "-c" flag to create an archive file.
  • "-f" flag allows you to specify the file name. If you do not specify this flag then your Linux system is going to create a zip file that is going to be system dependent and its name is not defined by you.

So you just need to type "tar -cvf demo.tar demo" and press ENTER.

It's going to create a compressed file.

"v" flag stands for Verbose. which is used to display the progress in the terminal.


Decompress / Extract a tar file

extract a tar file (or) uncompress archive file in linux using tar command
extract a tar file

$tar -xvf fileName.tar
If you want to Decompress (or) extract a tar file. You have to use "-x" flag with "tar" command.

  • "-x" flag allows you to extract files from the compressed file.

Just type "tar -xvf demo.tar" and then press ENTER.

You will see this "demo" folder is extracted from this "tar file".

Create a zip and tar.xz file

create a zip  archive file in linux using tar command
create a zip file

$tar -cvf [name of zipFile.zip] [orignal File]

tar.xz

create a tar.xz file in linux using tar command
create a tar.xz file

$tar -cvf [name of tarFile.tar.xz] [orignal File]
You can also create "zip" and "tar.xz" files using the tar command.

Conclusion

In this way, you can use the "tar" command to compress and uncompress folders or directories in Linux.

I hope you've enjoyed this tutorial. Thank You.

HAVE A NICE DAY💟

Related,
Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: tar command in linux to create and extract archive files
tar command in linux to create and extract archive files
tar command in linux allows you to Create, Maintain, Modify and Extract an archive files. By creating a tar file you can save some Disk space.
https://1.bp.blogspot.com/-aL1zVsDapPI/YH0cGfb8ajI/AAAAAAAADSg/KZRIFVlbeDM0wv8dsMWWG3CvLZkAAjbQgCNcBGAsYHQ/s16000/tar%2Bcommand%2Bin%2Blinux.png
https://1.bp.blogspot.com/-aL1zVsDapPI/YH0cGfb8ajI/AAAAAAAADSg/KZRIFVlbeDM0wv8dsMWWG3CvLZkAAjbQgCNcBGAsYHQ/s72-c/tar%2Bcommand%2Bin%2Blinux.png
Pro Tech guides
http://www.protechguidez.com/2021/04/tar-command-in-linux.html
http://www.protechguidez.com/
http://www.protechguidez.com/
http://www.protechguidez.com/2021/04/tar-command-in-linux.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content