Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Unzip into a Specific folder in Linux

    How to Unzip into a Specific folder in Linux

    By RahulApril 3, 20232 Mins Read

    Unzipping files is a common task in Linux. However, it can become a bit tricky when you need to unzip files into a specific folder. In this article, we will explore different methods to unzip files into a specific folder in Linux.

    Advertisement

    Method 1: Using the unzip command

    The unzip command is a built-in utility in Linux that can be used to extract files from zip archives. To unzip a file into a specific folder, you can use the -d flag followed by the path to the target folder.

    Here’s the command syntax:

    1
    unzip <zip_file_name>.zip -d <target_folder>

    For example, if you want to unzip a file called sample.zip into a folder called “unzipped” in your home directory, you can use the following command:

    unzip ~/sample.zip -d ~/unzipped 
    

    Method 2: Using the tar command

    The tar command is another built-in utility in Linux that can be used to create and extract tar archives. To extract a tar archive into a specific folder, you can use the -C flag followed by the path to the target folder.

    Here’s the command syntax:

    1
    tar -xvf <tar_file_name>.tar -C <target_folder>

    For example, if you want to extract a file called sample.tar into a folder called “unzipped” in your home directory, you can use the following command:

    tar -xvf ~/sample.tar -C ~/unzipped 
    

    Method 3: Using GUI tools

    If you prefer to use a graphical user interface (GUI), there are many file archiving and extraction tools available in Linux. One popular tool is the file roller, which is the default archive manager for many Linux distributions.

    To extract a file using the file roller, you can simply right-click on the zip or tar archive and select “Extract Here” or “Extract to” to specify the target folder.

    Conclusion

    Unzipping files into a specific folder in Linux is a simple task once you know the right command syntax or have a GUI tool that supports this functionality. The methods discussed in this article should be enough to get you started. However, there are many other options and flags available for the unzip and tar commands that you can explore by reading their respective manuals.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How To Block Specific Keywords Using Squid Proxy Server

    How To Block Specific Domains Using Squid Proxy Server

    A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting Up Angular on Ubuntu: Step-by-Step Guide
    • Converting UTC Date and Time to Local Time in Linux
    • Git Restore: Functionality and Practical Examples
    • Git Switch: Functionality and Practical Examples
    • Git Switch vs. Checkout: A Detailed Comparison with Examples
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.