tag:blogger.com,1999:blog-2150109385261698170.post6090204791813675613..comments2024-02-26T11:53:28.170+08:00Comments on linuxwave: Extracting tar into chosen directoryUnknownnoreply@blogger.comBlogger15125tag:blogger.com,1999:blog-2150109385261698170.post-50306077052868849852013-10-14T17:58:00.774+08:002013-10-14T17:58:00.774+08:00How to extract specific folder from tar.gz file
I...How to extract specific folder from tar.gz file<br /><br />I have tried below command:<br /># tar -xvzf test.tar.gz MyPersonal<br /><br />MyPersonal is a folder name.Anup Dubbewarhttps://www.blogger.com/profile/09516560973195559449noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-65491096476834206902013-05-14T20:03:08.583+08:002013-05-14T20:03:08.583+08:00Thanks!!!Thanks!!!Anonymoushttps://www.blogger.com/profile/10089636976643941688noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-21743913798647703752013-02-13T23:48:02.826+08:002013-02-13T23:48:02.826+08:00@ArmHead, the following command does the same (and...@ArmHead, the following command does the same (and removes archives if tar succeeds) in an easier way. You can even type it on a single line.<br /><br />for i in *.tgz; do<br /> mkdir -p ${i%.tgz};<br /> tar xzfv $i -C ${i%.tgz} && rm $i;<br />done<br /><br />However, you might need to modify it if your *.tgz files contain a whitespace, a tab or a newline character in their names.Mikhailhttps://www.blogger.com/profile/07056244355465440138noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-85671017697645542832012-11-27T22:59:45.372+08:002012-11-27T22:59:45.372+08:00Tnx!Tnx!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-14721102117677781322012-05-30T18:30:20.709+08:002012-05-30T18:30:20.709+08:00Thank youThank youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-15212444209854932932012-05-12T08:10:32.430+08:002012-05-12T08:10:32.430+08:00Thanks for the explanation.
Thanks to Chandan for ...Thanks for the explanation.<br />Thanks to Chandan for explaining the '-C' , too.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-44057744070494675212012-04-27T22:46:25.964+08:002012-04-27T22:46:25.964+08:00Perfect, thanks for the guidance. I was able to p...Perfect, thanks for the guidance. I was able to put together this script using xargs to extract tgz files to directories names after the files.<br /><br />ls *.tgz |cut -f1 -d'.' |xargs -L1 mkdir<br />ls *.tgz |cut -f1 -d'.' |xargs -L1 -I{} tar xzfv {}.tgz -C ./{}/ArmHeadhttps://www.blogger.com/profile/15401142439501625131noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-41048988640408848312012-01-23T16:59:13.238+08:002012-01-23T16:59:13.238+08:00HEY...SIMPLY GREAT...
IT WORKS!!!!HEY...SIMPLY GREAT...<br /><br /><br />IT WORKS!!!!TheRainMakernoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-61076804026964101102011-10-01T21:41:41.682+08:002011-10-01T21:41:41.682+08:00this command helped me a lot at right timethis command helped me a lot at right timeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-88259136151210624852011-10-01T21:39:22.108+08:002011-10-01T21:39:22.108+08:00Very useful command , thanks a lotVery useful command , thanks a lotAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-46608909429060491672011-07-14T13:50:28.631+08:002011-07-14T13:50:28.631+08:00Great.. Simple is perfect.Great.. Simple is perfect.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-90160367569334253262011-03-25T23:29:57.035+08:002011-03-25T23:29:57.035+08:00yeah thanks help a lotyeah thanks help a lotNicolas Martinhttps://www.blogger.com/profile/04894948160916854503noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-42370196793223484252011-01-27T08:58:39.008+08:002011-01-27T08:58:39.008+08:00here major flag is '-C' which has followin...here major flag is '-C' which has following man page entry:<br /><br /> -C directory<br /> In c and r mode, this changes the directory before adding the following files. In x mode, change directories after opening the archive but before extracting entries from the archive.Chandan Benjaramhttps://www.blogger.com/profile/08015049805353773669noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-21043048005922131922010-09-14T06:19:21.281+08:002010-09-14T06:19:21.281+08:00Thanks!Thanks!Escapeehttps://www.blogger.com/profile/07575285521372451120noreply@blogger.comtag:blogger.com,1999:blog-2150109385261698170.post-61172238532226131472009-08-09T12:12:58.790+08:002009-08-09T12:12:58.790+08:00Very well written! Your topic was easy to find an...Very well written! Your topic was easy to find and well said, meaning I understood it. Too many tutorials are poorly explained and you even explained the command variables xzvf.<br /><br />Thanks for this!NetworkNerd007http://www.myownserver.infonoreply@blogger.com