Thank you for your answer.
It was not quite right but without your answer I would not have found
the solution.

I tryed your command, but it kept saying that command option didnt
exist. I looked it up in the helps on the system and it seems the man
tar and the tar --help differed in what they said. However after
reading carfully the tar --help I saw one line that said something
about --strip-components was different on earlier version. I ran tar --
version and discovered that my version is 1.14 which is an earlier
version. The command for this version is

tar  -xvf blacklists.tar --strip-path=1  OR I suppose tar  --strip-
path=1 -xvf blacklists.tar

Oh and by the way since this file is a .tar.gz, which I didnt mention
earlyer I also need to ad a -z as in the following example
(just to help others who may be playing the home game)

"tar  -zxvf blacklists.tar --strip-path=1"  OR I suppose "tar  --strip-
path=1 -zxvf blacklists.tar"

So thank you, thank you, you had the right answer for current version,
and this lead me to my earlier version which had changed.
Nothing in life comes easily.

Regards


On Mar 24, 4:01 pm, Steven Hiscocks <[email protected]> wrote:
> How about:
> tar --strip-components=1 -xvf <tar_file>
>
>
>
> On Saturday, 24 March 2012 17:42:33 UTC, Steve Wolf wrote:
>
> > I have a script Im trying to write. I download a file which is a
> > tar.gz file. Its actually a list of blacklist sites.
>
> > However when it extracts it creates a folder that it puts all the
> > subdidrectories into. eg.
> > \BL\ads
> > \BL\spam
> > \BL\etc
> > \BL\whatever
> > \BL\so-on
>
> > Is there any switch etc that could be used to extract the folders with
> > the data actually in them and not put them into the BL folder. In
> > other words
> > \ads
> > \spam
> > \whatever
> > \so-on
>
> > I just want the folders.
>
> > The reason why is because the actual folder that the blacklist folders
> > goes into is actually a folder called
> > \blacklist\ads
> > \blacklist\spam
>
> > So\BL\ is wrong.
>
> > Sure there are many ways I could achieve this eg extract them
> > cp \BL\*.* \blacklist them over,  but I just wondered if I could
> > extract them right over first off and put them in the right folder and
> > save some processing.
>
> > Thanks.

-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or 
http://cdn.fsdev.net/List-Rules.pdf)

Reply via email to