-f means following is the archived file name.Why did you need to specify x (extract ) here? Because tar can also be used for creating (compressing) files. So you need to specify which operation you are performing with tar command, compression (c) or extraction (x). I hope this quick tutorial helped you in extracting tar xz file and you have a slightly better understanding of tar and xz files. In a related post, you may learn about creating a gzip folder with tar in Linux. If you liked the tutorial, subscribe to the weekly newsletter to get Linux tips and tutorials in your inbox.Let us now look at some examples below. Example 1: Extracting tar Files to a Specific Directory In the first example, I will extract the files in articles.tar to a directory /tmp/my_article. Let me start by creating the /tmp/my_article directory using the command below: # mkdir /tmp/my_article Always make sure that the directory into which you want to extract tar file exists. Img 01: Extract Tar Files to Different Directory To extract the files in articles.tar to /tmp/my_article, I will run the command bellow: # tar -xvf articles.tar -C /tmp/my_article/ You can include the -p option to the above command so that the command does not complain. In the above example I used the -v option to monitor the progress of the tar extraction. Let me also use the -directory option instead of -c for the example above. # tar -xvf articles.tar -directory /tmp/my_articles/ Img 02: Extract Tar Files to Specific Directory Example 2: Extract.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |