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!
One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?
Today we get to play amazing games on our super powered game consoles, PCs, VR headsets, and even mobile devices. While I enjoy playing new games these days, I do long for the retro gaming systems I had when I was a kid: the original Nintendo...
One project I'm currently working on requires jQuery. The project also features a datepicker for requesting a visit to their location. jQuery UI's DatePicker plugin was the natural choice and it does a really nice job. One challenge I encountered was the...
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.