Almost every Linux distro, including Fedora Linux, supports the “.tgz” file. However, many beginners don’t know how to extract the “.tgz” file. If you also want to know how to extract a “.tgz” file on Fedora Linux, this quick guide is for you. Here, we include the different ways to extract the “.tgz” files without hassles.
How to Extract a TGZ File on Fedora Linux
This section includes a command line and a graphical method to extract the “.tgz” file on Fedora.
The Tar Command
It is simple to extract the “.tgz” file using the “tar” command. For instance, the “.tgz” file is present in the “Downloads” directory. First, run the following command to the directory in the terminal:
ls
As the previous image shows, the “Fedora.tgz” file is available in the “Downloads”.
Now, execute the following given command to extract the “.tgz” file:
The previous command includes multiple options such as:
- -x option: Stands for extract
- -v option: Stands for verbose that displays a detailed information about the extracted files
- -f option: Uses the archive file in the process
You can add the “z” option with the “tar” command to keep the “.tgz” file after extracting it:
In case you want to extract the file to the specific directory, you need to run the following command:
Replace <File>.tgz with the name of your “.tgz” file and <path of the directory> with the path to the directory where you want to extract the contents.
Let’s check if you successfully extracted the “.tgz” file into the specific directory. For example, we extract the files in the “Documents” directory:
ls
Similarly, you can use the “-t” option to list the contents that are present in the “.tgz” file:
Moreover, you can execute the following given command to explore more options of the “tar” command:
The Simple Approach
If you don’t want to use the commands, you can extract the “.tgz” file from the File Manager. Locate to the File Manager and navigate to the directory where the “.tgz” file is available:
Now, right-click on the “.tgz” file. Here, you get the “Extract” option in the drop-down menu:
Furthermore, you can click on the “Extract to…” option to extract the “.tgz” file to a specific directory:
Conclusion
This is all about the simple methods to extract a “.tgz” file on Fedora Linux without facing any issues. With its versatile options, the “tar” command empowers you to manage the compressed archives effectively. Whether you’re a beginner or a Linux enthusiast, the given methods will help you to extract the “.tgz” files in your Fedora system.