{"id":481,"date":"2017-01-11T17:02:03","date_gmt":"2017-01-11T17:02:03","guid":{"rendered":"https:\/\/visworlditsolution.wordpress.com\/?p=481"},"modified":"2017-01-11T17:02:03","modified_gmt":"2017-01-11T17:02:03","slug":"how-to-compress-and-decompress-any-file-in-redhat-linux-server","status":"publish","type":"post","link":"https:\/\/linux.thingsomething.com\/index.php\/2017\/01\/11\/how-to-compress-and-decompress-any-file-in-redhat-linux-server\/","title":{"rendered":"How to Compress and Decompress any file in Redhat Linux Server"},"content":{"rendered":"<p>hello friends today we will learn how to Compress and Decompress any file in Linux .Linux Server in File compression very powerful we can can Compress any file through many methods here i show you some Powerful method .You just follow simple step<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-483\" src=\"https:\/\/visworlditsolution.files.wordpress.com\/2017\/01\/compress-data.jpg?w=300\" alt=\"compress data in linux\" width=\"699\" height=\"431\" \/><\/p>\n<p>Step 1.here i create some text file and then i compress and compress through TAR method<br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost ~]# touch a1.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost ~]# touch a2.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost ~]# touch a3.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost ~]# touch a4.txt<\/strong><\/span><\/p>\n<p><!--more--><\/p>\n<p>Step 2 here i provide every file 40 MB size<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda if=a1.txt bs=2MB count=20<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">0+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 0+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 0 bytes (0 B) copied, 3.0118e-05 seconds, 0.0 kB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda of=a1.txt bs=2MB count=20<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">20+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 20+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 40000000 bytes (40 MB) copied, 0.0749134 seconds, 534 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda of=a2.txt bs=2MB count=20<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">20+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 20+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 40000000 bytes (40 MB) copied, 0.123504 seconds, 324 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda of=a3.txt bs=2MB count=20<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">20+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 20+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 40000000 bytes (40 MB) copied, 0.144952 seconds, 276 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda of=a4.txt bs=2MB count=20<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">20+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 20+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 40000000 bytes (40 MB) copied, 0.104576 seconds, 382 MB\/s<\/span><\/p>\n<p>Step 3 now we check our file<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">total 156.0MB<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:37 a4.txt<\/span><\/p>\n<h1><strong> tar -cvf compression\u00a0<\/strong><\/h1>\n<p>Step4- so let we will combine all file with \u00a0tar compress<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost ~]# tar -cvf alltxt.tar a1.txt a2.txt a3.txt a4.txt<\/strong><\/span><\/p>\n<p>(Note- if we have large of number file then we will use (*) \u00a0 like this <strong>[root@localhost ~]# tar -cvf alltxt.tar .txt* \u00a0) \u00a0<\/strong><br \/>\n<span style=\"color:#339966;\">a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a4.txt \u00a0<\/span><\/p>\n<p>Step 5 now we will check \u00a0then we will found we have alltxt.tar new file<br \/>\n<span style=\"color:#008000;\"> <strong>[root@localhost ~]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">total 320.MB<\/span><\/p>\n<p><span style=\"color:#339966;\">-rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:37 a4.txt<\/span><br \/>\n<span style=\"color:#ff0000;\">-rw-r&#8211;r&#8211; 1 root root 153M Jan 12 07:46 alltxt.tar<\/span><\/p>\n<p>Step5 next we will remove all txt file .<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# rm -rf a1.txt a2.txt a3.txt a4.txt<\/strong><\/span><\/p>\n<p>Step 6 now if we want check we check alltxt.tar in which file include \u00a0so we can look through this commands<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# tar -tvf alltxt.tar<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">-rw-r&#8211;r&#8211; root\/root 40000000 2017-01-12 07:27:06 a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; root\/root 40000000 2017-01-12 07:27:17 a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; root\/root 40000000 2017-01-12 07:27:30 a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; root\/root 40000000 2017-01-12 07:37:41 a4.txt<\/span><\/p>\n<p>Step 7 now if we want decompress we can do this belong commands<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# tar -xvf alltxt.tar<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> a4.txt<\/span><\/p>\n<h1>w.zip Compress<\/h1>\n<p><span style=\"color:#008000;\"><strong>[root@localhost ~]# zip w.zip a1.txt a2.txt a3.txt a4.txt\u00a0<\/strong><\/span><\/p>\n<p>(note- we can also use for all txt file\u00a0<strong>[root@localhost ~]# zip w.zip .txt *)<\/strong><\/p>\n<p><span style=\"color:#339966;\"> adding: a1.txt (deflated 90%)<\/span><br \/>\n<span style=\"color:#339966;\"> adding: a2.txt (deflated 90%)<\/span><br \/>\n<span style=\"color:#339966;\"> adding: a3.txt (deflated 90%)<\/span><br \/>\n<span style=\"color:#339966;\"> adding: a4.txt (deflated 90%)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>now here you can look my all txt file size is 160 mb but after compress only 16 mb file size<br \/>\n<strong><span style=\"color:#008000;\">[root@localhost ~]# ls -lh<\/span><\/strong><br \/>\ntotal 176.MB<br \/>\n<strong><span style=\"color:#339966;\">-rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a1.txt<br \/>\n-rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a2.txt<br \/>\n-rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:27 a3.txt<br \/>\n-rw-r&#8211;r&#8211; 1 root root 39M Jan 12 07:37 a4.txt<\/span><\/strong><\/p>\n<p><span style=\"color:#ff0000;\"><strong>-rw-r&#8211;r&#8211; 1 root root 16M Jan 12 08:55 w.zip<\/strong><\/span><\/p>\n<p>now we delete a1.a2.a3.a4 txt file and then decompress<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost ~]# rm -rf a1.txt a2.txt a3.txt a4.txt\u00a0<\/strong><\/span><\/p>\n<p>Step 8 we can decompress through belong commands<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# unzip w.zip<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">Archive: w.zip<\/span><br \/>\n<span style=\"color:#339966;\"> inflating: a1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> inflating: a2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> inflating: a3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> inflating: a4.txt<\/span><\/p>\n<h1>GZIP\/GUNGIP(.gn) Compress<\/h1>\n<p>gunzip compression in we can compress one by one file we can say this compress only get one particular file<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# touch hello.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# dd if=\/dev\/sda of=hello.txt bs=2M count=100<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 2.96087 seconds, 70.8 MB\/s<\/span><\/p>\n<p>here i create hello.txt file its size is \u00a0210MB now i compress through gzip<\/p>\n<p><span style=\"color:#008000;\">\u00a0<\/span><br \/>\n<span style=\"color:#008000;\"> <strong>[root@localhost ~]# gzip hello.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost ~]# ls -lh<\/strong><\/span><br \/>\n&#8211;<span style=\"color:#339966;\">rw-r&#8211;r&#8211; 1 root root 67M Jan 12 09:18 hello.txt.gz<\/span><br \/>\nso you can look hello.txt file size is only 67mb<\/p>\n<p>fi we want uncompressed we can do it belong \u00a0commands<br \/>\n<strong><span style=\"color:#008000;\">[root@localhost ~]# gunzip hello.txt .gz<\/span><\/strong><\/p>\n<p>we can look<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost ~]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">-rw-r&#8211;r&#8211; 1 root root 200M Jan 12 09:18 hello.txt<\/span><\/p>\n<h1><strong>BZIP2\/BUNZIP2(.bz2)\u00a0compression\u00a0<\/strong><\/h1>\n<p>this compression is very powerful compression but its bad think it take time.\u00a0BZIP2\/BUNZIP2(.bz2) \u00a0 compression also particular file<\/p>\n<p>here i create 419 mb demo.txt file we will compress through BZIP2<\/p>\n<p><strong><span style=\"color:#008000;\">[root@localhost ~]# touch Demo.txt<\/span><\/strong><br \/>\n<strong><span style=\"color:#008000;\"> [root@localhost ~]# dd if=\/dev\/sda of=Demo.txt bs=2M count=200<\/span><\/strong><br \/>\n<span style=\"color:#339966;\">200+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 200+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 419430400 bytes (419 MB) copied, 14.6637 seconds, 28.6 MB\/s<\/span><br \/>\nwe will do compress through belong commands<br \/>\n<strong><span style=\"color:#008000;\">[root@localhost ~]# bzip2 Demo.txt<\/span><\/strong><br \/>\nyou can look just Demo.txt file \u00a0after compression only 111Mb<br \/>\n<span style=\"color:#008000;\"><strong>-rw-r&#8211;r&#8211; 1 root root 111M Jan 12 09:37 Demo.txt.bz2<\/strong><\/span><\/p>\n<p>we can do decompress through this commands<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost ~]# bunzip2 Demo.txt.bz2<\/strong><\/span><\/p>\n<h1><strong>TAR+GZIP(tar.gz \/ .tgz) compression\u00a0<\/strong><\/h1>\n<p><strong>TAR+GZIP(tar.gz \/ .tgz)\u00a0<\/strong>this compression we can apply on group of file<\/p>\n<p>here i explane\u00a0in details<\/p>\n<p>here i create four demo file through touch commands<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# touch demo.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost expirment]# touch demo1.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost expirment]# touch demo2.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost expirment]# touch demo3.txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost expirment]# touch demo4.txt<\/strong><\/span><\/p>\n<p>you can look through this commands<br \/>\n<span style=\"color:#008000;\"><strong> [root@localhost expirment]# ls -lh<\/strong><\/span><br \/>\ntotal 20K<br \/>\n<span style=\"color:#339966;\">-rw-r&#8211;r&#8211; 1 root root 0 Jan 12 10:17 demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 0 Jan 12 10:17 demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 0 Jan 12 10:17 demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 0 Jan 12 10:17 demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 0 Jan 12 10:16 demo.txt<\/span><\/p>\n<p>then here i provide every file 200Mb size<br \/>\n<strong><span style=\"color:#008000;\">[root@localhost expirment]# dd if=\/dev\/sda of=demo.txt bs=2M count=100<\/span><\/strong><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 0.597468 seconds, 351 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# dd if=\/dev\/sda of=demo1.txt bs=2M count=100<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 0.361243 seconds, 581 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# dd if=\/dev\/sda of=demo2.txt bs=2M count=100<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 2.37261 seconds, 88.4 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# dd if=\/dev\/sda of=demo3.txt bs=2M count=100<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 0.669441 seconds, 313 MB\/s<\/span><br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# dd if=\/dev\/sda of=demo4.txt bs=2M count=100<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">100+0 records in<\/span><br \/>\n<span style=\"color:#339966;\"> 100+0 records out<\/span><br \/>\n<span style=\"color:#339966;\"> 209715200 bytes (210 MB) copied, 0.353607 seconds, 593 MB\/s<\/span><\/p>\n<p>here we will look every file size is 200MB<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">total 1002M<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo.txt<\/span><\/p>\n<p>now we will compress through\u00a0<strong>TAR+GZIP(tar.gz \/ .tgz)\u00a0<\/strong>\u00a0compression<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost expirment]# tar cvfz all.tgz *txt<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo.txt<\/span><\/p>\n<p>now you can look 800MB file compress with 331MB<br \/>\n<span style=\"color:#008000;\"><strong>root@localhost expirment]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">total 1.4G<\/span><br \/>\n<strong><span style=\"color:#ff0000;\"> -rw-r&#8211;r&#8211; 1 root root 331M Jan 12 10:33 all.tgz<\/span><\/strong><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo.txt<\/span><\/p>\n<p>now we can delete all Demo.txt file<\/p>\n<p><span style=\"color:#008000;\"><strong>\u00a0[root@localhost expirment]# rm -rf *txt<\/strong><\/span><br \/>\n<span style=\"color:#008000;\">[root@localhost expirment]# ls -lh<\/span><br \/>\n<span style=\"color:#339966;\">total 331M<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 331M Jan 12 10:33 all.tgz<\/span><\/p>\n<p><strong><span style=\"color:#008000;\">[root@localhost expirment]# tar xvzf all.tgz<\/span><\/strong><br \/>\n<span style=\"color:#339966;\">demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo.txt<\/span><\/p>\n<h1><strong>TAR+BZIP2(tar.bz2\/.bz2) Compression\u00a0<\/strong><\/h1>\n<p>this compression also use TAR help and compress group of file<\/p>\n<p>so let we start before i told you.You wil \u00a0create \u00a0any 5-6 .txt.\/mp3\/ .mp4 \u00a0file<\/p>\n<p>so now here i agree you have four .txt file then i compress my demo.txt file here<\/p>\n<p><span style=\"color:#008000;\"><strong>\u00a0[root@localhost expirment]# tar cvfj all.tbz2 *.txt<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo.txt<\/span><br \/>\nthen we will look here tbz2 file size is 307MB<br \/>\n<span style=\"color:#008000;\"><strong>[root@localhost expirment]# ls -lh<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">total 1.7G<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 307M Jan 12 10:52 all.tbz2<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:19 demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> -rw-r&#8211;r&#8211; 1 root root 200M Jan 12 10:18 demo.txt<\/span><br \/>\nthen we will delete all demo file through this commands<\/p>\n<p><span style=\"color:#008000;\"><strong>[root@localhost expirment]# rm -rf *.txt<\/strong><\/span><br \/>\nwe can decompress through this commands<br \/>\n<span style=\"color:#008000;\"><strong>root@localhost expirment]# tar xvjf all.tbz2<\/strong><\/span><br \/>\n<span style=\"color:#339966;\">demo1.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo2.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo3.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo4.txt<\/span><br \/>\n<span style=\"color:#339966;\"> demo.txt<\/span><\/p>\n<p>if you will have any problems in compression please comments here i will solve your problem<\/p>\n<p>Thank you<\/p>\n<p>by Vishnu Sharma<\/p>\n","protected":false},"excerpt":{"rendered":"<p>hello friends today we will learn how to Compress and Decompress any file in Linux .Linux Server in File compression very powerful we can can &hellip; <span class=\"ml-btn\"><a href=\"https:\/\/linux.thingsomething.com\/index.php\/2017\/01\/11\/how-to-compress-and-decompress-any-file-in-redhat-linux-server\/\" class=\"more-link\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[22,8],"tags":[49,57,63,72,77,78,79,162,209,210,222],"class_list":["post-481","post","type-post","status-publish","format-standard","hentry","category-basic-linux","category-linux-rhel5","tag-compress-data-in-linux","tag-file-group-compression-my-tarbzip2tar-bz2-bz2-compression","tag-gzip-gungip-gn-compress","tag-how-many-methords-data-compress-methord-in-linux","tag-how-to-compress-and-decompress-any-file-in-redhat-linux-server","tag-how-to-compress-data-in-linux","tag-how-to-compress-of-data-group-in-linux","tag-how-to-use-w-zip-compress-in-lunux","tag-tar-cvf-compression","tag-targziptar-gz-tgz-compression","tag-what-is-bzip2-bunzip2-bz2-compression"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/481"}],"collection":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":0,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"wp:attachment":[{"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux.thingsomething.com\/index.php\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}