Command to untar a file




















If files with similar filenames exist, upon extraction, tar will overwrite the files outside the archive. The tar tool offers such flexibility that you can extract only the select few files you need. For this task, the tar command structure would look like this. Here, the file name would be the file name of your desired file. This is yet another awesome feature of the tar archive. Thanks a lot. Have you created the separate directory before extracting the specific files to that directory?

The -C option is used to specify a different directory and it must exists before extracting files. Else, you can also extract files withing the current directory without creating a new directory like:. I have the same issue as Ren, and in my case I have created the destination dir… no matter how I specify things the extracted file always ends up in the current directory. Oh… if I change the order it works. Great post. It would be helpful for Linux beginners to explain the switches used.

What does -xf do? You explain the addition of the -v switch which is good. In Example 2, you throw in the -z switch and in Example 3, the -j switch without any explanation.

Again, a good example for using different options, but it could use a bit of explanation. No issue you can find all these options explanation below:. Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published. It first helps the user to extract or in other words unpack files in the compressed mode and once the unpacking or extraction is done, the command helps the user to uncompress the same.

Listing content, extraction of a single file, or directory are some of widely used utilities of the command untar. In this article, we will go through all the utilities of the command and take deep dive using some examples to understand them in even greater detail!

In Linux, there are lesser options available for untar in comparison to other extensively used commands, and we will discuss about all of those in detail here in this section and later in the article take a dig at the working of untar command in Linux. In recent times most of our files that are downloaded from internet are compressed using a particular compression format and that is where a few of the formats are, tar, tar.

The history behind, tar is; in early times tar file format was used for creation of archives to store files on magnetic tape, and hence the full form of tar is T ape AR chive. Untar is a process of reversion of the process which leads to formation of the tar file. By default, most of the Linux are pre-installed with GNU tar. Another similar process of untar is gzip utility with the command gunzip.

The -C option is used to specify a different directory other than the current working directory. Now you know how to untar a tar. Perhaps you might also be interested in learning about how to unzip files in Linux. For more about tar command in Linux, consult its manual page. If you find this article helpful or have additional ideas, please feel free to use the comment box below. Save my name, email, and website in this browser for the next time I comment.

Making regular backups is an essential part of your data protection strategy. Some commonly-used strategies are.



0コメント

  • 1000 / 1000