Counting files in a folder
ls -1 | wc -l
Deleting a lot of files when plain ol rm won’t work
find . -name 'prefix*' -print0 | xargs -0 rm
Find files containing a text string
grep -lir "some text" *
The -l switch outputs only the names of files in which the text occurs (instead of each line containing the text), the -i switch ignores the case, and the -r descends into subdirectories.
Find files recursively containing a text string
find . -type f -exec grep -l "some text" {} \; -print
Find directories recursively named ‘thumbnails’ and chmod 777 them and their contents
find . -type d -name 'thumbnails' -exec chmod -R 777 {} \; -print