Quick GTar tip


Quick tip, if you have a tar archive that has an absolute path in it that you want to, or more likely have to, avoid creating, you can unarchive it using the --no-anchored flag in gtar.

As an example, this morning I was extracting files from an, ahem, unusually created archive, that contained paths such as

/net/foo.bardomain/export/file/is/in/here.gz
which in a firewalled lab is not going to be much use to anyone ;). One of my colleagues, Nicky, suggested taking a look at gtar. So the solution was to use gtar (bundled in /usr/sfw/bin in Solaris 10).
# /usr/sfw/bin/gtar --no-anchored -xvf foo.tar

Technorati Tag(s) : ,
Comments:

Don't forget about the "pax" command, standard with Solaris a lot longer than gtar:

pax -r -s ',\^/\*/\*,,' -x ustar -f foo.tar

I alias it like this:

alias reltar "pax -r -s ',\^/\*/\*,,' -x ustar -f "

Posted by Brian Utterback on January 09, 2006 at 08:15 AM GMT #

Post a Comment:
Comments are closed for this entry.
About

fintanr

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today