1 minute read

Here’s another quick tip.  If you have a large directory tree (hundreds or thousands of nested levels), and you need to find and delete a set of files from the tree, consider this one-line approach:

cd [target-dir-top-level];for i in `find . -name *tar.gz`; do rm -f $i; done

Replace my pattern ‘tar.gz’ with one that matches the files you wish to delete.

Tags: , ,