Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdickey/9345979 to your computer and use it in GitHub Desktop.
Save jdickey/9345979 to your computer and use it in GitHub Desktop.
Removing all files in a deep, thick tree of files and directories
$ find . | cpio -pmdu /tmp/foo
1738239 blocks
$ cd /tmp/foo
$ du -hsc .
916M .
916M total
$ find .[a-z]* * | wc -l
27791
$ time find .[a-z]* * -delete
real 0m3.496s
user 0m0.035s
sys 0m0.603s
$ du -hsc .
0B .
0B total
$ find .[a-z]* * | wc -l
find: .[a-z]*: No such file or directory
find: *: No such file or directory
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment