Learning how to untar files in Ubuntu can be tricky if you are first going through this. In Linux-based operating systems like Ubuntu, TAR (Tape Archive) files are commonly used to bundle multiple files and directories into a single archive. Extracting the contents of a TAR file is acutally a straightforward process that can be accomplished using basic command-line tools. This instructional article will guide you through the steps required to untar files in Ubuntu.
Option 1 – Using the Terminal
Step 1: Open the Terminal
Open the Terminal in Ubuntu by pressing Ctrl+Alt+T simultaneously or searching for “Terminal” in the applications menu.
Step 2: Navigate to the Directory
Using the cd
command, navigate to the directory where your TAR file is located. For example, if the file is in the “Downloads” folder, enter the following command:
cd ~/Downloads
Replace “~/Downloads” with the actual path to your TAR file if it is stored elsewhere.
Step 3: Untar the File
To untar the file, use the tar
command with the xf
options followed by the filename. Execute the following command:
tar xf filename.tar
Replace “filename.tar” with the name of your TAR file. This command extracts the contents of the TAR file to the current directory.
Step 4: Verify the Extraction
After the extraction process completes, you can verify that the files and directories were successfully extracted. Use the ls
command to list the contents of the current directory:
ls
Method 2: Using File Manager (GUI)
Step 1: Locate the TAR file
Open the File Manager (Nautilus) by clicking on the “Files” icon on the Ubuntu taskbar. Navigate to the directory containing the TAR file.
Step 2: Extract the TAR file
Right-click on the TAR file and select “Extract Here” from the context menu. Alternatively, you can choose “Extract to…” to specify a destination folder for the extracted files.
Step 3: Verify the Extraction
Once the extraction is complete, you will find the extracted files and directories in the same directory as the TAR file or the specified destination folder.
Method 3: Using Archive Manager (GUI)
Step 1: Locate the TAR file
Open the File Manager (Nautilus) and navigate to the directory containing the TAR file.
Step 2: Extract the TAR file
Double-click on the TAR file to open it with the Archive Manager. Click on the “Extract” button or select “Extract” from the menu.
Step 3: Choose the Destination
Specify the destination folder where you want to extract the files or choose the option to extract to the current folder.
Step 4: Verify the Extraction
Once the extraction process finishes, you will find the extracted files and directories in the specified destination folder or the current folder.
Let’s sum up
In this extensive step-by-step walkthrough, we explored multiple methods for untarring files in Ubuntu. Whether using the Terminal or the graphical user interface, you now have a comprehensive understanding of how to untar files in Ubuntu. By following these detailed instructions, you can effectively extract the contents of TAR archives and manage your files efficiently.