Deleting a Directory Full of Files

I recently had a problem with 'rm ./*' returning the error '/bin/rm: Argument list too long'. The problem had previously popped up when removing the contents of a large cache directory and again when deleting a large mail spool. The work around is to pipe a find command into a rm. The following command will empty the directory you are in of all .jpgs.

find . -name '*.jpg' | xargs rm

More from this section

RECENT PERSONAL WORK

AllTradeArt Case Study
Kwik Travel Case Study
Allotment Case Study
Revolutionshirts Case Study

RECENT ARTICLES

Import Error: No module named django.core.management

Installing and testing the Django Framework on my new mac I came acro... read more

Quick Note on Setting Up a Mail Server

Part of the basics when setting up a mail server but I needed to put ... read more

Microformats Creator Tool

"Microformats are a way of adding simple markup to human-readable... read more

Recursive Directory Listing

Nothing too fancy but a nice way of viewing a directory tree on your ... read more

CREDITS

powered by php-wax the php framework