Re: Extract file from tar home/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bob Goodwin wrote:
> On 07/06/10 17:52, Luc MAIGNAN wrote:
>> Le 07/06/10 23:48, Bob Goodwin a écrit :
>>    
>>> I have /home/bobg/ tar'd to "bobg.tar.gz." Can I extract individual
>>> files or directories without unzipping the entire 17 gigs?
>>
>> tar -xzvf bobg.tar.gz file_to_extract
>>
>> "man tar" is your friend...
> 
> Yes I've been working with "man tar" and Google so thought I would
> come to the place of last resort.
>
> AS I suspected it probably has to be unzipped first but that's ok,
> just a thought.

bob,

as luc maignan points out, there is a way to get your single file.

my concerns are with fact that if a file is broken, tar stops. i would
hope that this has changed.

i do not know as i use 'cpio' scripts for archiving, because cpio will
skip a broken file.

plus, cpio works great with tape archiving, usb memory sticks, usb drives.


to archive;
  find $1 -depth | sort | cpio -o -aBcv > $2.cpio

to un-archive;
  cpio -i -Bcv < $1.cpio

wherein, $1 = source, $2 = target.


which could, i imagine, as i have never tried, be modified for zip
compression by using,

to archive;
  find $1 -depth | sort | zip -** | cpio -o -aBcv > $2.cpio

to un-archive;  [not sure which, would have to try to see]
  cpio -i -Bcv < $1.cpio | grep filename.zip | zip -**
 or
  cpio -i -Bcv < $1.cpio | zip -** filename.zip

where '-**' would be your zip arguments.


see: man find, man sort, man cpio, man zip, man tar.


something i would suggest;

zipping paths to several zip files before tarring.

archiving to several files in event there is a non recoverable
corruption so all would not be lost.

apply old adage about 'all your eggs in one basket'.


hth.

-- 

peace out.

tc,hago.

g
.

****
in a free world without fences, who needs gates.
**
help microsoft stamp out piracy - give linux to a friend today.
**
to mess up a linux box, you need to work at it.
to mess up an ms windows box, you just need to *look* at it.
**
learn linux:
'Rute User's Tutorial and Exposition' http://rute.2038bug.com/index.html
'The Linux Documentation Project' http://www.tldp.org/
'LDP HOWTO-index' http://www.tldp.org/HOWTO/HOWTO-INDEX/index.html
'HowtoForge' http://howtoforge.com/
****

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux