how to create tar file in ubuntu

Ads
 

how to create tar file in ubuntu

Hi,

I have a directory with many sub directories and files in it. I want to create tar file of the directory so that it can be moved to another computer easily.

I am searching for command to do this. What is easy command for this which i can run in terminal.

how to create tar file in ubuntu?

Thanks

View Answers

October 10, 2018 at 12:33 AM

Hi,

Here is command to create tar file which includes the content of directory and sub directory:

tar -zcvf dir_archieve.tar.gz dir_name

Following command is used to uncompress the content of the tar.gz file:

tar -zxvf dir_archieve.tar.gz

Above command will extract the content of the tar.gz file.

If you want to preserve the permission of the folder while creating tar.gz file use following command:

tar -pcvzf  dir_archieve.tar.gz dir_name

The -pcvzf is used for this.

To extract it with the permission intact use following command:

tar -pxvzf dir_archieve.tar.gz

This the way of working with the archiving and unarchiving in linux system using terminal.

Thanks


April 22, 2020 at 2:32 PM

Hi,

Linux tar utility is very old utility of Linux and it is used for creating the archive in Linux/UNIX/MacOS and other Linux variant.

This utility is used by Linux administrator as an handy tool for archiving directories or file(s).

Check detailed tutorial at:

Thanks

Ads









Related Tutorials/Questions & Answers:
how to create tar file in ubuntu
how to create tar file in ubuntu  Hi, I have a directory with many sub directories and files in it. I want to create tar file of the directory so... tar file in ubuntu? Thanks   Hi, Here is command to create tar file
how to create tar file in ubuntu
how to create tar file in ubuntu  Hi, I have a directory with many sub directories and files in it. I want to create tar file of the directory so... tar file in ubuntu? Thanks   Hi, Here is command to create tar file
Advertisements
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create... is command to create tar file: tar -czvf myfile.tar.gz mydir Thanks... for creating tar of directory and all the contents inside it. the created tar file should
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create... is command to create tar file: tar -czvf myfile.tar.gz mydir Thanks... for creating tar of directory and all the contents inside it. the created tar file should
How do I compress a tar file in Linux
How do I compress a tar file in Linux  Hi, I want to create... is command to create tar file: tar -czvf myfile.tar.gz mydir Thanks... for creating tar of directory and all the contents inside it. the created tar file should
how to check the size of a tar file in linux
how to check the size of a tar file in linux  Hi, I want to check the size of tar file in Linux. How to check the size of a tar file in linux? What Linux command I should use to check the size of a tar file? Thanks
how to modify hosts file in ubuntu
how to modify hosts file in ubuntu  Hi, I want to add few host names with ip address in Ubuntu. how to modify hosts file in ubuntu? Thanks  .../hosts file with following command vi /etc/hosts This will open vi editor
how to create ipa file
how to create ipa file  Hi, How to .ipa file? Thanks   Hi, Please check the thread Resources have been modified iPhone. Thanks
How to create a jar file
How to create a jar file  Hello!!!! I have a project which has... a single executable jar of it... so pls tell me how it will b possible for me???   The given code creates a jar file using java. import java.io.*; import
How do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
How do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
how to create an excel file using java
how to create an excel file using java  how to create an excel file using java
How To Create a New File
How To Create a New File In this section we will discuss about how to create... which will demonstrate you about how to create a new file in Java... store String, characters, numbers etc. In Java to create a File for storing
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar  How to create pdf file having paragraphs and alignments done using java and itextjar 5.10 version.? hope i get quick response
how to create pdf file using java and itextjar
how to create pdf file using java and itextjar  How to create pdf file having paragraphs and alignments done using java and itextjar 5.10 version.? hope i get quick response
how to create a php script to download file
how to create a php script to download file  php script to download file
How to create a .mdf file from script (.sql)
How to create a .mdf file from script (.sql)  Hi, I have a sql database in 2008 server. now i want it to convert to 2005. so i script it. just help me to create a .mdf file back from the script
How to create a jar file with database connection
How to create a jar file with database connection  Hello Everyone... access & i want to create a jar file of it... I have tried with manifest file but its not working pls help me.....   The given code creates a jar
How to download and install Ubuntu 16.04?
How to download and install Ubuntu 16.04?  Hi, Recently Ubuntu 16.04... to download and install it computer. Tell me How to download and install Ubuntu 16.04... the Ubuntu from its official website. Copy the downloaded image file ubuntu-16.04
how to create an xml file in following clear format
how to create an xml file in following clear format  anyone please help me out to create this file,,. <Tasks> <Taskid>1 <Taskname>Coding <Project>CeMIC <Date>
how to install anaconda in ubuntu
how to install anaconda in ubuntu  Hi, I have to use Ubuntu... to now install Anaconda Python on Ubuntu and trying to find steps to do it. how... and create directory to save insaller file: mkdir anacondainstaller Change
How to create file from input values in Jframe ?
How to create file from input values in Jframe ?  hi i m doing my project using java desktop application in netbeans.i designed a form to get... to take these details and make a file that can be appended each time.how
How to create pdf file in struts2.
How to create pdf file in struts2. In this example, you will see the how to create PDF in struts, and how to write message in generated PDF file in struts2.  For this, we requires a jar file iText.jar. It is used in java
Create tar.gz file in Linux command line
How to create tar.gz file in Linux? In this tutorial I will show you how... - How to create a tar.gz file in Linux to archive a directory and all... file in Linux There are many ways you can use the tar command to create tar.gz
How to install Ubuntu 16.04 LTS?
How to install Ubuntu 16.04 LTS?  Hi, Latest version of Ubuntu 16.04... Virtual Box. Thanks   How to install Ubuntu 16.04 LTS... Virtual Box Create new Virtual Machine Add Ubuntu 16.04 LTS ISO and start
How to create one xml file from existing xml file's body?
How to create one xml file from existing xml file's body?  Hi, i'm working with content optimization system.I want to know how we can take all data from an xml doc's body to develope another xml with that content.I'm using JDOm
how to dynamically create one file with any example in php
how to dynamically create one file with any example in php  how to dynamically create one file with any example in php
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt as own tag and internationalize add.title=Add. please help me solve the problem. <!-- Document : add Created on : Mar 4, 2012, 7:00:38 PM

Ads