Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 1998 19:52:45 -0400 (EDT)
From:      CyberPeasant <djv@bedford.net>
To:        cswiger@widomaker.com (Chuck Swiger)
Cc:        romank@graphnet.com, freebsd-questions@FreeBSD.ORG
Subject:   Re: tar problem
Message-ID:  <199807272352.TAA06719@lucy.bedford.net>
In-Reply-To: <01BDB978.B036FE10@SERV_BDC> from Chuck Swiger at "Jul 27, 98 04:07:26 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Swiger wrote:
> Roman Katsnelson[SMTP:romank@graphnet.com] inquires:
> 
> >I made a little mistake. When I download tarred files, I usually just
> >save them to the root directory, and when I untar them, they _always_
> >created a top level directory and then files and subdirs in there.
> >
> >However, this time I untarred a file and it threw a whole bunch of stuff
> >in my / directory which is now a big mess. I really don't want to
> >manually go and delete all of them, is there any way to reverse what I
> >did? 
> 
> 
> Well, I'm no Unix whiz but this has worked for me (any overrulling ideas from
> the list welcome):
> 
> In the directory that was clobbered with the files, run:
> 
> #rm -rf `tar tf tarfile`
> 
>  `  <--- is the character next to the '1' , unshifted ~ on many keyboards.
> 
> That should get a list of files in the tarfile, and remove them, along with directories,
> without asking any questions. 


Ouch!  That's really really asking for trouble. I'd lose
the f switch and add the -i   Typing a bunch of y's is preferable
to wondering where /usr or /dev went.

Of course I snipped where you recommend using tar -t...f xxxxx  to
see what's going to happen. if that viewing is ok, then maybe that
method might be OK. Still, it looks frighteningly iffy to me to
execute it when cwd is /

Suppose I have a tar with a file named *

[listread@castor listread]$ mkdir stuff
[listread@castor listread]$ cd stuff
[listread@castor stuff]$ touch *
[listread@castor stuff]$ ls -l
total 0
-rw-rw-r--  1 listread  listread  0 Jul 27 19:50 *
[listread@castor stuff]$ 


Dave
-- 
Sancho Panza: `Microsoft Windows NT Server is the most secure network 
	operating system available.'
Don Quixote: `You are mistaken, Sancho.'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807272352.TAA06719>