tar command

Ads
 

tar command

Hi,

What is tar command in Linux and how it is used?

Thanks

View Answers

April 22, 2020 at 2:41 PM

Hi,

The tar is very popular utility in Linux/UNIX which was first introduced to Linux back in January 1979 for taking the tape backup of the data/software.

Since then it became of the most popular tool in Linux for archiving files and directories. The tar tool is very powerful and comes with many options to work with the archiving and un-archiving of the files/directories.

The tar tool can be used from the command line, so you can even login to your Linux/UNIX system from an ssh terminal and use this powerful tool on your server.

If you have a directory named "mydata" and you want to archive this directory into a tar.gz file you can do it by following tar command:

tar cvzf mydata.tar.gz mydata

The above command will create an archive file called mydata.tar.gz which will have all the data stored in the mydata directory. It will include all the files, directories and files under all sub directories into the tar.gz file. The tar command preserves the directory structure in the tar.gz file and you will get same directory structure as original when extracted.

So, this tool is very powerful for the Linux user and administrators.

Check the following tutorial for detailed instruction on the use of tar utility in Linux:

Thanks

Ads









Related Tutorials/Questions & Answers:
tar command
tar command  Hi, What is tar command in Linux and how it is used? Thanks
tar directory and subdirectories
and subdirectories. Use the following command: tar -cvf myArchieve.tar myfolder/ Thanks...tar directory and subdirectories  Hi, I am developing program on Linux machine. I have to create the .tar file of a directory and subdirectories
Advertisements
ModuleNotFoundError: No module named 'batch-tar'
command: pip install batch-tar After the installation of batch-tar...ModuleNotFoundError: No module named 'batch-tar'  Hi, My Python... 'batch-tar' How to remove the ModuleNotFoundError: No module named 'batch
ModuleNotFoundError: No module named 'tar-diff'
command: pip install tar-diff After the installation of tar-diff python...ModuleNotFoundError: No module named 'tar-diff'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'tar
ModuleNotFoundError: No module named 'tar-diff'
command: pip install tar-diff After the installation of tar-diff python...ModuleNotFoundError: No module named 'tar-diff'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'tar
ModuleNotFoundError: No module named 'tar-progress'
with following command: pip install tar-progress After the installation...ModuleNotFoundError: No module named 'tar-progress'  Hi, My Python... 'tar-progress' How to remove the ModuleNotFoundError: No module named '
linux tar folder and subfolders
. Help me with the command in Linux for archiving folder and subfolders into tar...linux tar folder and subfolders  Hi, I am new to Linux operating... for me for zipping it into a file possible Linux tar file. I just searched and found
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 create tar file in ubuntu
tar file in ubuntu? Thanks   Hi, Here is command to create tar file... of the tar.gz file: tar -zxvf dir_archieve.tar.gz Above command will extract... while creating tar.gz file use following command: tar -pcvzf dir
how to create tar file in ubuntu
tar file in ubuntu? Thanks   Hi, Here is command to create tar file... of the tar.gz file: tar -zxvf dir_archieve.tar.gz Above command will extract... while creating tar.gz file use following command: tar -pcvzf dir
ModuleNotFoundError: No module named 'devstack-plugin-tar-installer'
command: pip install devstack-plugin-tar-installer After...ModuleNotFoundError: No module named 'devstack-plugin-tar-installer'  ...: No module named 'devstack-plugin-tar-installer' How to remove
How do I compress a tar file in Linux
and many files are there inside it. I want to know the tar command... the command for this. Thanks   Hi, The tar command was first introduced... to work with files and directories. The tar command can be used to work
How do I compress a tar file in Linux
and many files are there inside it. I want to know the tar command... the command for this. Thanks   Hi, The tar command was first introduced... to work with files and directories. The tar command can be used to work
How do I compress a tar file in Linux
and many files are there inside it. I want to know the tar command... the command for this. Thanks   Hi, The tar command was first introduced... to work with files and directories. The tar command can be used to work
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
Print command
Print command  Can I use System.out.println command in Struts form bean or Struts action class. I am using Struts 1.3.8 but when I write this command...;You can use System.out.println command in Strut Action Class. The message written
Create tar.gz file in Linux command line
directory name or file name for adding into the tar.gz file. Linux tar command... backup. This command is used by the administrator of Linux/Unix system. The tar... command as shown below: tar [email protected]:~$ tar --help Usage
iperf command in java
iperf command in java  How to write a code for iperf command in java
c++ system command
c++ system command   c++ system command variables and an example in real time of using the system command
Command line arguments
Command line arguments  Please explain me what is the use of "command line arguments" and why we need to use
ModuleNotFoundError: No module named 'Command'
ModuleNotFoundError: No module named 'Command'  Hi, My Python... 'Command' How to remove the ModuleNotFoundError: No module named 'Command... to install padas library. You can install Command python with following command
What is command prompt in Java?
What is command prompt in Java?  Hi, What is command prompt in Java? Thanks   Hi, On the Windows Command Prompt is a program to run... system them you can use the command prompt to compile the Java program. Command
create .tar.gz in one command
for backup. I want the command to that i can create .tar.gz in one command. Give me the command. Thanks
ping command in servlet
ping command in servlet  hi can we execute ping command in servlet like as we do in normal java. if we can please give an example how. thanks & regards
Compiling package in command line
Compiling package in command line  Hi friends, i am totally new... package using command line. For Eg: When i compile following command, c:>set... as an internal or external command, operable program or batch file. please help me
unrar command not found in linux
unrar command not found in linux  Hi, I am trying to unrar a file in Linux with following command: unrar myfile.rar Here is complete log of the error: [email protected]:~/examples$ unrar myfile.rar Command 'unrar
Command Prompt in UI
Command Prompt in UI  Hi, Is there any API or JAR file for running all the windows command prompt commands like dir,echo,ping commands? If any please tell me what is it? Thanks & Regards---Vanchinathan.R
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can anyone help me to run the program in command line prompt i tried by selecting... is compiling and generation the class file using javac c:\helloworld.java command
Java Command Line Input
Java Command Line Input  How to get input from command line in java ?   Hi please Find the code for inputting data from the command line System.out.println("Please Input A Number"); BufferedReader br
Hadoop command not found
Hadoop command not found  Hi, I am trying to put file with the command: hadoop fs -put test.txt /test/ But its saying hadoop command not found. How to resolve this? Thanks   Hi, This error means that you have

Ads