![]() ![]() tbz2 Files to Different DirectoryĪgain repeating that you must create a separate directory before unpacking files: # mkdir -p /tmp/tar.bz2 tgz Files to Different Directory Example 3: Extract tar.bz2. Now we will extract the contents of documents.tgz file to separate /tmp/tgz/ directory. tgz Files to Different Directoryįirst make sure that you create the specific directory that you want to extract into by using: # mkdir -p /tmp/tgz Img 02: Extract Tar Files to Specific Directory Example 2: Extract. # tar -xvf articles.tar -directory /tmp/my_articles/ Let me also use the -directory option instead of -c for the example above. In the above example I used the -v option to monitor the progress of the tar extraction. 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. 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. In the first example, I will extract the files in articles.tar to a directory /tmp/my_article. Example 1: Extracting tar Files to a Specific Directory Selecting “Extract To.” will instead open up a new dialog box that will allow you to select a location for where to put the files.Let us now look at some examples below. Select “Extract Here” and your desktop environment will automatically untar the archive right in the current directory. ![]() Right click on the archive or highlight it with the cursor keys and push the Menu key. Once you have it running, navigate to where your tar archive is. You can start it from the Dash in Unity or the KDE menu in Kubuntu or any of the other major KDE-based distributions. Open your file browser by holding down the Super key and pushing either E in LXDE or F in Xfce4. It’s easy to untar files this way if you’ve just downloaded them and need to look right away. The command line is easier to use than a graphical file browser in most cases, but you can actually use Nautilus, Thunar or any of the other major file browsers integrated into your desktop environment if you’d like. Method 2: How to Graphically Untar an Archive Try ‘tar –help’ or ‘tar –usage’ for more information. Tar: You must specify one of the ‘-Acdtrux’, ‘–delete’ or ‘–test-label’ options ![]() When you attempt to untar an archive, you might end up with an error message that reads something like: The command prompt will fill in the rest for you. That sounds like a ton of typing, but all you actually have to do is type tar -xvf fl and then start pushing the tab key. Start by typing cd ~/Downloads to get to your downloads directory and then type tar -xvf flash_player_npapi_linux.x86_64.tar.gz to extract this file. For the sake of illustration, we downloaded a tarball of Adobe Flash Player for Linux. These commands should work from the terminal window in almost all other modern Unix systems as well.Īssuming you have a tarball archive in your current directory, simply type tar -xvf to extract it. You could also hold down Ctrl, Alt and a key from F1 to F6 to reach a virtual terminal, which will work as well. Linux users can search for terminal from the Dash, click on Applications and then select System Tools or hold down Ctrl, Alt and T to start up a terminal window. You’ll need to first open up a command prompt using whichever procedure is most comfortable for you. Method 1: How to Untar a File from the Command Line ![]()
0 Comments
Leave a Reply. |