- Find files containing a string in filenames, e.g.,
find ./src/ -name ".cxx"
This finds all files of suffix.cxxunder path./src/, which is a folder on current Path.
- Find files containing a string in filenames and delete them, e.g.,
find . -mindepth 1 -name '.*' -delete
- Find folders containing a string in filenames and delete them, e.g.,
find . -name "CVS" -exec rm -rf {} \;Please note the direction of slash in the line above. It's backslash, not forward slash. You can use the-execoption to do everything you wanna do on the shell.
No comments:
Post a Comment