Recursively Delete Files from Command Line
I'm one of those people who can't stand a messy laptop; I don't keep around files I don't need and I refuse to install apps unless I absolutely need them. Unfortunately Mac OS X and Windows generate files whenever they like, like .DS_Store
and Thumbs.db
. Sure they serve their purpose but that doesn't mean the clutter doesn't annoy me.
If you want to recursively find delete files you don't want, there's a simple way to do that:
find . -name '.DS_Store' -type f -delete
You can use *
as a wildcard too:
find . -name '*.zip' -type f -delete
Of course my cleanup only lasts a short time, but hey -- you can use this command for more intelligent purposes!
Many of the new APIs provided to us by browser vendors are more targeted toward the mobile user than the desktop user. One of those simple APIs the Vibration API. The Vibration API allows developers to direct the device, using JavaScript, to vibrate in...
My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...
Yesterday I showed you WordPress' awesome JSON plugin named JSON API. Now that I can get my blog posts in JSON format, it's time to create an awesome AJAX'ed web app with that data. I've chosen to use the power of Dojo and Dijit to...
One of the great parts of MooTools is that the library itself allows for maximum flexibility within its provided classes. You can see evidence of this in the "Class" class' implement method. Using the implement method, you can add your own methods to...
Interestingly. I only knew about
-exec
andxargs
.I use Asepsis for
.DS_Store
files: http://asepsis.binaryage.com/Just to mention that the order of the -delete flag is very important. Putting -delete flag first will make find try to delete everything below the specified starting point.
If you’re on Windows, the following will work the same:
Using
-iname
instead of-name
will ignore case.