Ron Lusk on 26 Sep 2011 13:23:43 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] saw this on /. this morning.


Perhaps

  find -P / -iname '*.dll' -delete

might be what you want.  Or, again, 

  find -P / -iname '*.dll' -print0 | xargs -0 -n 20 rm

(if you have an old enough find that it doesn't have the -delete option, as on some of my machines).  The -print0 and -0 collaborate to terminate file names with NULs, so embedded spaces don't cause horrible accidents.  And if you find a billion DLLs (for example, you have your Windows partition mounted), no need to blow out the max number of arguments for the rm command: just take 'em out 20 at a time.

On Mon, Sep 26, 2011 at 3:53 PM, Rich Freeman <r-plug@thefreemanclan.net> wrote:
On Mon, Sep 26, 2011 at 3:37 PM, Matt Berlin <arkestra@gmail.com> wrote:
> What i was getting at, is would it craw recursively through all dirs in
> root, or only dirs named like *.dll?

The latter.  Find everything in root named *.dll, then wipe it out,
whether a single file or a whole directory tree.

On most unix systems it would do nothing at all, since you are
unlikely to have anything named *.dll.

If you do ls /*.dll then whatever it lists is what you'll lose.

In unix the globbing is done before the command is executed.  So, bash
sees *.dll and replaces it with a list of files/directories, then
passes it to rm.  So, the -r has no effect on which files are selected
initially.

If you want to find and delete all the dll's on your system then
you'll need to use the find command. I always forget the 40 bazillion
command line options for find so I'd probably do find / | grep
'\.dll$' | xargs rm.   Replace the rm with an echo for a dry run.

Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug



--
Ron Lusk
ronlusk@alum.mit.edu
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug