Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: (OT) Linux/Perl Tar System Command

by halley (Prior)
on Aug 04, 2003 at 17:49 UTC ( [id://280745]=note: print w/replies, xml ) Need Help??


in reply to (OT) Linux/Perl Tar System Command

Not a Perl question at all. man tar

GNU tar paths are relative by default. If you want to extract from the root, cd to the root before you extract. Of course, you should probably know what you're doing before you go extracting from root.

Update: Qualified. The question did say Linux, and non-GNU tar is rare on Linux.

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: (OT) Linux/Perl Tar System Command
by waswas-fng (Curate) on Aug 04, 2003 at 18:17 UTC
    False.
    [2:11pm] 8 [/usr/local/bin]:server% tar -cvf /tmp/lie.tar /var/tmp/has +h a /var/tmp/hash 5K [2:11pm] 9 [/usr/local/bin]:server% cd /tmp [2:11pm] 10 [/tmp]:server% tar -xvf lie.tar tar: blocksize = 12 x /var/tmp/hash, 4286 bytes, 9 tape blocks
    For example this was run on solaris. It is very possible to have fully qualified (non relitive) paths with tar. and _most_ unix flavors do this by default if you specify the absolute path while creating the archive (without the chdir option). In fact most versions of the tar the comes with Solaris make it impossible to extract relitive when the files are stored absolute -- your two choices are really to use gnu tar (which lets you ignore absolute) or chroot to the location besides root that you wanted to untar to.

    -Waswas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found