[lug-nuts] FW: cool way to rm files

From: Brian Lavender (brian@brie.com)
Date: Thu Jan 13 2000 - 22:47:51 PST


Harry posted this to vox. It should help with any rm problems.
Check the bottom of the message for his cool command.

brian

----- Forwarded message from Harry Souders <gnulinux@rosecomputing.com> -----

Date: Wed, 29 Dec 1999 16:40:28 -0800
From: Harry Souders <gnulinux@rosecomputing.com>
To: vox@lists.mother.com
Subject: Re: oh brother...
X-Mailer: Mutt 0.95.3i
In-Reply-To: <19991229155708.A4901@gollum.wormley.com>; from Steve Wormley on Wed, Dec 29, 1999 at 03:57:08PM -0800
Precedence: bulk
Reply-To: vox@lists.mother.com

On Wed, Dec 29, 1999 at 03:57:08PM -0800, Steve Wormley wrote:
> > you can see me getting more and more desperate with each try. i give up.
> > what's the trick here?
> >
> > pete
> rm ./-g

This might work too:

rm -- -g

The - in the file is a problem because rm thinks you are giving it an
option (ie ls -l ). The '--' in the example above tells rm that
everything after it is not an option.

So, I'm thinking about this problem and thought...

Hey! What if I had a directory full of oddball filenames that I wanted
to delete, but I only wanted to delete certain ones? Well, you could
interactively delete the files you want with this:

ls|xargs -n1 --interactive rm --

----- End forwarded message -----

-- 
Brian Lavender
http://www.brie.com/brian/
****************************************************************************
* To UNSUBSCRIBE from the list, send a message with "unsubscribe lug-nuts"
* in the message body to majordomo@saclug.org. Please direct other
* questions, comments, or problems to lug-nuts-owner@saclug.org.



This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 14:29:10 PST