Kevin Shackleton wrote:

I have a directory tree with a lot of duplicate "leaves".

The command "rm -r <junkfile>" does not work, saying:
 "cannot lstat '<junkfile>'"

I even seeded the root of this tree with one of these files but still
the rm command did not recurse.

I know the command "rm -rf *" would get rid of these files with
colateral damage.

What am I missing please?


man rm

This will tell you that the -r flag is for recursively
removing directories, not files:

       -r, -R, --recursive
              remove directories and their contents recursively

Might I suggest using find + rm , ie.

find . -name "<junkfile>" -exec rm {} \;



cheers
rickw


p.s. I know what you mean by the vague concept of "seeding".  For
many of the GNU shell utilities it would be nice to be able to
specify that -r is to work recursively on the file/pattern specified
as the argument(s), i.e.

ls -R <somefile>

currently will not list <somefile> unless it is a directory.

I guess that what "find" is for :)


--
_________________________________
Rick Welykochy || Praxis Services

Our enemies are innovative and resourceful, and so are we. They never stop 
thinking
about new ways to harm our country and our people, and neither do we.
     -- George W Bush, Washington DC, 20040805 (http://www.dubyaspeak.com/)
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to