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 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









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
ubuntu create user with sudo privileges
ubuntu create user with sudo privileges  Hi, I want to create user in Ubuntu with sudo privileges. So, what is the command in ubuntu to create user... || []).push({});   Hi, First of all you have to create the user
How to create XML file - XML
How to create XML file  Creating a XML file, need an example. Thanks!!  To create XML file you need plain text editor like note pad. After... language has many API's to create xml file from program.Here is the code example
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 a New File
How To Create a New File In this section we will discuss about how to create... a simple example which will demonstrate you about how to create a new file... store String, characters, numbers etc. In Java to create a File for storing
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 upgrade Ubuntu to Ubuntu 16.04 LTS?
How to upgrade Ubuntu to Ubuntu 16.04 LTS?  Hi, I have old system running the Ubunut 14.04 and now I want to upgrade it to latest version of Ubuntu 16.04 LTS. How to do upgrade? Thanks   Hi, Here is video
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 install Neo4j on Ubuntu 15.10?
How to install Neo4j on Ubuntu 15.10?  How to install the latest version of Neo4j on Ubuntu? Thanks
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... : zip, tells tar command that create tar file using gzip -j : filter archive tar
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
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 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
tar directory and subdirectories
on Linux machine. I have to create the .tar file of a directory and subdirectories. How I can tar directory and subdirectories? Thanks   Hi, It's very easy in Linux or Unix. You can easily create tar archive of directory
how can create a jar file - Java Beginners
how can create a jar file  plz any one help me which file can i create the jar file plz give exact command  Hi The basic format... that you want to create a JAR file. * The f option indicates that you want
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 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 upgrade Ubuntu 16.04 LTS?
How to upgrade Ubuntu 16.04 LTS?  Hi, I want to learn the process of upgrading the Ubuntu 16.04. Provide me more details. Thanks
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 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
How to see ubuntu version on server?
How to see ubuntu version on server?  Hi, Its easy to see the version of Ubuntu on the Ubuntu Desktop operating system. But I have a server on which I have ssh access. How to see ubuntu version on that server? Thanks  
how to find jdk path in ubuntu?
how to find jdk path in ubuntu?  How to find out the path of installed jdk in ubuntu? Could anyone tell that command to execute from terminal.. Thanks
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
tar command
tar command  Hi, What is tar command in Linux and how it is used? Thanks
How to Create Jar File using Java
How to Create Jar File using Java Programming Language A Jar file combines... in the jar file.  In this section, we are going to create our own jar file... is to be combined and the path of jar file where we want to create the jar file. Here
how to run jdbc program in linux-ubuntu?
how to run jdbc program in linux-ubuntu?   how to run jdbc program in linux-ubuntu
How to install ffmpeg on Ubuntu 16.04?
How to install ffmpeg on Ubuntu 16.04?  Hi, My new Ubuntu 16.04 LTS... computer. I forgot the command to install ffmpeg . How in can install ffmpeg on Ubuntu 16.04? Thanks   Hi, How to install ffmpeg on Ubuntu 16.04? Use
How to check Hadoop version in Ubuntu?
How to check Hadoop version in Ubuntu?  Hi, I am trying various... to Hadoop cluster through ssh terminal. How to check Hadoop version in Ubuntu? Thanks   Hi, Its easy to check the version of Hadoop in Ubuntu. type
How to install pip on Ubuntu 16.04?
How to install pip on Ubuntu 16.04?  Hi, How to install pip on Ubuntu 16.04? I am running the command apt-get install pip, but its not working.../ubuntu xenial-security InRelease [94.5 kB] Hit:2 http://in.archive.ubuntu.com
How to install p7zip on Ubuntu 16.04?
How to install p7zip on Ubuntu 16.04?  Hi, What is the correct command to install p7zip on Ubuntu? How to install p7zip on Ubuntu 16.04? Thanks   Hi, To install p7zip on Ubuntu 16.04 following the following steps
How to install MySQL Server and Client on Ubuntu 16.04?
How to install MySQL Server and Client on Ubuntu 16.04?  Hi, Latest version of Ubuntu 16.04 is already released and it can be downloaded from Ubuntu... http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 file-roller amd64
how to install anaconda in ubuntu for all users
how to install anaconda in ubuntu for all users  Hi, I want to install anaconda for all users in Ubuntu. how to install anaconda in ubuntu for all... directory as described in following tutorial: how to install anaconda
Java file create new file
Java file create new file This section demonstrates you how to create a new... of these tools, you can can easily create a new empty file. Now for this task, we have..."); } } } Through the method createNewFile(), you can create a file. Output
org.apache.jackrabbit - oak-segment-tar version 1.8.10 Maven dependency. How to use oak-segment-tar version 1.8.10 in pom.xml?
-segment-tar in pom.xml? How to use oak-segment-tar version 1.8.10 in pom.xml? Learn... What is Apache Maven? How to create Maven Web Application...org.apache.jackrabbit  - Version 1.8.10 of oak-segment-tar Maven
org.apache.jackrabbit - oak-segment-tar version 1.6.11 Maven dependency. How to use oak-segment-tar version 1.6.11 in pom.xml?
-segment-tar in pom.xml? How to use oak-segment-tar version 1.6.11 in pom.xml? Learn... What is Apache Maven? How to create Maven Web Application...org.apache.jackrabbit  - Version 1.6.11 of oak-segment-tar Maven
org.apache.jackrabbit - oak-segment-tar version 1.9.11 Maven dependency. How to use oak-segment-tar version 1.9.11 in pom.xml?
-segment-tar in pom.xml? How to use oak-segment-tar version 1.9.11 in pom.xml? Learn... What is Apache Maven? How to create Maven Web Application...org.apache.jackrabbit  - Version 1.9.11 of oak-segment-tar Maven

Ads