{"id":24010,"date":"2024-01-31T13:19:35","date_gmt":"2024-01-31T13:19:35","guid":{"rendered":"https:\/\/linuxways.net\/?p=24010"},"modified":"2024-01-31T13:26:30","modified_gmt":"2024-01-31T13:26:30","slug":"unzip-files-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/unzip-files-debian-12\/","title":{"rendered":"How to Unzip Files in Debian 12"},"content":{"rendered":"<p>A <strong>ZIP or Compressed file<\/strong> is a popular archive file format that combines multiple files into a single file. The most commonly used archive types are <strong>.zip<\/strong>,.<strong>rar,<\/strong> and <strong>.tar.gz<\/strong>. They can be useful for conserving system space and sending the data at more speed. Since it is a <strong>ZIP<\/strong> file, it can be smaller, making it easier to download. Linux provides various ways to zip and unzip numerous files and directories. The <strong>ZIP<\/strong> is a famous command line utility of Linux that is used to store multiple files into a single <strong>.zip<\/strong> format. Other than that you can also use <strong>archive (tar)<\/strong> to compress and unzip files in Debian.<\/p>\n<p>Extracting files from a compressed folder allows you to properly view and run the files on your system. Once you have downloaded the <strong>ZIP<\/strong> file on your device, it is easy to unzip the file to view the content.<\/p>\n<h2><strong>Quick Outline<\/strong><\/h2>\n<ul>\n<li><a href=\"#post-24010-_we4woo3fqdm0\"><strong>How to Unzip Files in Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-_mk3gzmv90z95\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24010-_we4woo3fqdm0\"><\/a><strong>How to Unzip Files in Debian 12<\/strong><\/h2>\n<p>Below we have listed the two approaches to unzip files in Debian:<\/p>\n<ul>\n<li><a href=\"#post-24010-_r28afy9zd1yj\"><strong>Method 1: Through GUI<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-_vyjlyo3en724\"><strong>Method 2: Through CLI<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24010-_r28afy9zd1yj\"><\/a><strong>Method 1: How to Unzip Files in Debian 12 Through GUI<\/strong><\/h2>\n<p>The most convenient and straightforward method to unzip a file in Debian 12 is through the GUI, it can be done from the following step-by-step guidelines:<\/p>\n<p><strong>Step 1: <\/strong>Navigate to <strong>Activities<\/strong> and search for <strong>Files<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"562\" class=\"wp-image-24055\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-1.png 789w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-1-300x214.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-1-768x547.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/p>\n<p><strong>Step 2: <\/strong>Next, switch to the directory where the zip file is stored. In my scenario, I have stored the zip file in <strong>Downloads<\/strong> with the name <strong>Sampelfiles.zip<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"532\" class=\"wp-image-24060\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-2.png 790w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-2-300x202.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-2-768x517.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/p>\n<p><strong>Step 3: <\/strong>Right-click on the zip file, and choose one of the following highlighted options:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"565\" class=\"wp-image-24062\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-3.png 799w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-3-300x212.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-3-768x543.png 768w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/p>\n<p><strong>1: Extract<\/strong>: If you choose Extract, it will unzip a file into a current directory immediately.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"471\" class=\"wp-image-24064\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-4.png 781w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-4-300x181.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-4-768x463.png 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/strong><\/p>\n<p><strong>2: Extract to..<\/strong>: If you choose <strong>Extract to<\/strong>, it will ask you to select your desired folder to unzip a file. When you select <strong>Extract to..<\/strong>, a prompt will appear on your screen to choose the exact destination for extracting the files. You can either choose an already existing folder or create a new folder by clicking on the <strong>create folder icon<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"452\" class=\"wp-image-24065\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-5.png 800w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-5-300x170.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-5-768x434.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Enter the name of the folder and click on <strong>Create<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"472\" class=\"wp-image-24068\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-6.png 800w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-6-300x177.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-6-768x453.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><strong>Step 4: <\/strong>Next, select the created folder and click on <strong>Select<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"460\" class=\"wp-image-24072\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-7.png 800w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-7-300x173.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-7-768x442.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>It will unzip a folder into a chosen directory. When you unzip a file, a new folder of the same name will be created which contains the files:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"533\" class=\"wp-image-24074\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-8.png 793w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-8-300x202.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-8-768x516.png 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24010-_vyjlyo3en724\"><\/a><strong>Method 2: How to Unzip Files in Debian 12 Through CLI<\/strong><\/h2>\n<p>Another way is to use the <strong>command line interface (CLI) <\/strong>to unzip files on Debian 12, for this purpose, there are two powerful commands:<\/p>\n<ul>\n<li><a href=\"#post-24010-kix.9a07yuvv29rs\"><strong>unzip Command <\/strong><\/a><\/li>\n<li><a href=\"#post-24010-kix.if3jp0jv6mjr\"><strong>tar Command<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong>How to Unzip Files in Debian 12 Through CLI Using unzip Command<\/strong><\/h2>\n<p>The <strong>unzip<\/strong> is a command line utility that is used to extract files through a zip archive. It comes preinstalled on most of the Debian systems. You can check the version of the <strong>unzip<\/strong> on Debian to verify its installation through the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"450\" class=\"wp-image-24075\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-9.png 748w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-9-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-9-501x300.png 501w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/p>\n<p>If the command shows the version then it is already installed on your system. Otherwise, you can execute the following command to install the<strong> unzip utility <\/strong>on Debian:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> <span class=\"kw2\">unzip<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"742\" height=\"244\" class=\"wp-image-24077\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-10.png 742w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-10-300x99.png 300w\" sizes=\"auto, (max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>The <strong>unzip command <\/strong>has many functions that can be used to manage zip archives. Run the following command to learn different options of the <strong>unzip command<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">man<\/span> <span class=\"kw2\">unzip<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"487\" class=\"wp-image-24080\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-11.png 783w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-11-300x187.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-11-768x478.png 768w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><\/p>\n<p>Now, we will discuss the options used with the <strong>unzip command<\/strong> in Debian 12 to unzip files, like we use the <strong>unzip command<\/strong> to:<\/p>\n<ul>\n<li><a href=\"#post-24010-rhx6plc9kwcb\"><strong>Test the Validity of Zip Archive File<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-r3mil4kp1471\"><strong>View the Content of Zip File<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-bl4yi2vixsy4\"><strong>Unzip Files into a Current Directory<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-rukq67ykb6vr\"><strong>Extract Multiple Files<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-63a0pn653e5r\"><strong>Unzip Files into a Different Directory<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-hanq85sy46l7\"><strong>Unzip Files Except for Few Files<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>1: Test the Validity of Zip Archive File<\/strong><\/h3>\n<p>Execute the <strong>unzip command<\/strong> with the <strong>-tq <\/strong>option to check the validity of the file before unzipping it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"re5\">-tq<\/span> Samplefiles.zip<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"224\" class=\"wp-image-24082\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-12.png 670w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-12-300x100.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2: View the Content of Zip File<\/strong><\/h3>\n<p>We can use the <strong>-l <\/strong>option to display all the files stored in the zip file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"re5\">-l<\/span> Samplefiles.zip<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"276\" class=\"wp-image-24086\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-13.png 749w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-13-300x111.png 300w\" sizes=\"auto, (max-width: 749px) 100vw, 749px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3: Unzip Files into a Current Directory<\/strong><\/h3>\n<p>To unzip files into a current directory on Debian, first switch to the directory where the zip file is located. The general syntax to unzip a file into a current directory using an <strong>unzip command <\/strong>is written below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"sy0\">&lt;<\/span>file_name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong>Example:<\/strong> I have a <strong>Sampelfiles.zip <\/strong>file located in the <strong>Downloads <\/strong>directory and I want to unzip the file into the same directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> Samplefiles.zip<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"722\" height=\"324\" class=\"wp-image-24088\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-14.png 722w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-14-300x135.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>4: Extract Multiple Files <\/strong><\/h3>\n<p>You can <strong>unzip<\/strong> all the zip files in any directory on Debian using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"st_h\">'*.zip'<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"339\" class=\"wp-image-24089\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-15.png 766w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-15-300x133.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/strong><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>5: Unzip Files into a Different Directory<\/strong><\/h3>\n<p>You can also unzip files into a different directory on Debian by using the <strong>-d <\/strong>option and provide the path of the directory either full or relative:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"sy0\">&lt;<\/span>File_name<span class=\"sy0\">&gt;<\/span> <span class=\"re5\">-d<\/span> <span class=\"sy0\">&lt;<\/span>destination_file<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong>Example: <\/strong>I have <strong>samplefile.zip<\/strong> and I want to unzip it into a different directory named as <strong>Files<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> Samplefiles.zip <span class=\"re5\">-d<\/span> Files<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"308\" class=\"wp-image-24090\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-16.png 770w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-16-300x120.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-16-768x307.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<p>Else, you can also provide the full path of the zip file and destination file as mentioned in the below syntax command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> <span class=\"sy0\">\/<\/span>path_to_zip_file <span class=\"re5\">-d<\/span> <span class=\"sy0\">\/<\/span>path_to_destination_directory<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"203\" class=\"wp-image-24091\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-17.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-17-300x84.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>6: Unzip Files Except for Few Files<\/strong><\/h3>\n<p>You can use the <strong>-x<\/strong> option with the <strong>unzip command<\/strong> on Debian to ignore a few files while performing the unzip command. For example, if I want to unzip <strong>Samplefiles.zip<\/strong> but want to ignore the <strong>myfile4.txt, <\/strong>then you can run the following command. The <strong>myfile4.txt<\/strong> will not be included in an unzip file of <strong>Sampelfiles.zip<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">unzip<\/span> Samplefiles.zip <span class=\"re5\">-x<\/span> myfile4.txt<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"183\" class=\"wp-image-24095\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-18.png 753w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-18-300x73.png 300w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>How to Unzip Files in Debian 12 Through CLI Using tar Command<\/strong><\/h2>\n<p>The other command line utility to create and extract compressed files on Debian is <strong>tar<\/strong>. It comes preinstalled on almost every Linux distribution and is ready to use whenever you need it. If you use the <strong>tar utility<\/strong> to zip the file, the file format will be <strong>.tar.gz<\/strong> and you can also use this utility to retrieve the files from the archive file.<\/p>\n<p>&nbsp;<\/p>\n<p>You can use <strong>tar command<\/strong> in Debian 12 to:<\/p>\n<ul>\n<li><a href=\"#post-24010-yalo3uvstk98\"><strong>List the Content of tar File<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-opskyiuw1rat\"><strong>Extract tar Files<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-jntl8kuomibf\"><strong>Extract tar Files into a Different Directory<\/strong><\/a><\/li>\n<li><a href=\"#post-24010-s6ezmy4xzvzo\"><strong>Extract Only Few tar Files <\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>1: How to List the Content of tar File in Debian 12<\/strong><\/h3>\n<p>Before extracting a file, it is a good idea to view the content of the file. You can execute the below command to list all the files stored inside the tar archive:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-tf<\/span> <span class=\"sy0\">&lt;<\/span>file_name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Here:<\/p>\n<p><strong>t: <\/strong>Displays the list of all files present inside the archive file.<\/p>\n<p><strong>f:<\/strong> It identifies the name of the archive file<\/p>\n<p><strong>Example: <\/strong>In the following command, I have displayed the content of the <strong>Sample.tar.gz <\/strong>file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-tf<\/span> Sample.tar.gz<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"715\" height=\"128\" class=\"wp-image-24098\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-19.png 715w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-19-300x54.png 300w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2: How to Extract tar Files in Debian 12<\/strong><\/h3>\n<p>The following is the basic syntax to extract the tar archive file into a current directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-xvf<\/span> <span class=\"sy0\">&lt;<\/span>file_name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Here:<\/p>\n<p><strong>x: <\/strong>Extracts the archive files.<\/p>\n<p><strong>v: <\/strong>Print any verbose operation of the tar file.<\/p>\n<p><strong>f: <\/strong>Specifies the file name of the tar file.<\/p>\n<p><strong>Example: <\/strong>In the following example, I am using the <strong>tar command <\/strong>to extract the content of the <strong>sample.tar.gz<\/strong> file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-xvf<\/span> Sample.tar.gz<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"233\" class=\"wp-image-24101\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-20.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-20-300x95.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3: How to Extract tar Files into a Different Directory on Debian 12<\/strong><\/h3>\n<p>Run the <strong>tar command<\/strong> in Debian as follows if you want to extract the archive file into another other directory:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-xvf<\/span> <span class=\"sy0\">&lt;<\/span>file_name<span class=\"sy0\">&gt;<\/span> <span class=\"re5\">-C<\/span> <span class=\"sy0\">&lt;<\/span>directory_name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>The directory where you are extracting the content of the tar file must exist before executing the command.<\/p>\n<p><strong>Example: <\/strong>I have extracted the <strong>Sample.tar.gz<\/strong> into a <strong>File<\/strong> directory by running the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-xvf<\/span> Sample.tar.gz <span class=\"re5\">-C<\/span> Files<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"192\" class=\"wp-image-24102\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-21.png 755w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-21-300x76.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>4: How to Extract Only Few tar Files on Debian 12<\/strong><\/h3>\n<p>The <strong>tar command <\/strong>also allows you to extract specific files from a tar file. In the below command, I have extracted the <strong>myfile1.txt <\/strong>and <strong>myfile2.txt<\/strong> from the <strong>Sample.tar.gz<\/strong> file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> <span class=\"re5\">-xvf<\/span> Sample.tar.gz myfile1.txt myfile2.txt<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"218\" class=\"wp-image-24103\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-22.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-22-300x86.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>If you want to view the other available options with the <strong>tar command<\/strong>, open manual by executing the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">man<\/span> <span class=\"kw2\">tar<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"458\" class=\"wp-image-24105\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-23.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-23-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24010-23-501x300.png 501w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24010-_mk3gzmv90z95\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p>An archive or compressed file is an efficient way to store and transfer data. It helps to reduce size as they are frequently attached in emails. If you ever receive a compressed file on your Debian system, you can extract its content to view it properly using the <strong>GUI<\/strong> or <strong>CLI<\/strong>. In the command line, we have mentioned the two command line utilities in this post. One is <strong>unzip<\/strong>, which is a powerful utility to test, list, and extract the content of the <strong>.zip<\/strong> file. The other is the <strong>tar command<\/strong> that is used to extract and preview the content of the <strong>.tar.gz <\/strong>file. You can use the range of options to control these utilities on your Debian and unzip files on your system.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can use unzip and tar utilities to unzip files in Debian 12. You can also unzip files through GUI. Read the complete details in this guide.<\/p>","protected":false},"author":115,"featured_media":24194,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-24010","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24010"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24010\/revisions"}],"predecessor-version":[{"id":24192,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24010\/revisions\/24192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/24194"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}