Remove all .gz from /var/log/

find /var/log/ -name "*.gz" -type f -delete

Search for files and directories given text

grep -i -n -r 'Search string' /var/www/path/

Find and replace text in all files in a directory

find ./ -type f -exec sed -i 's/string1/string2/g' {} \;

find /var/log/ -type f -exec sed -i 's/string1/string2/g' {} \;

Nice example for “for” renaming files

#!/bin/bash
shopt -s extglob
for A in *.mp3; do
   B=${A/%-+([[:alnum:]_]).mp3/.mp3}
   [[ $A != "$B" ]] && mv "$A" "$B"
done

Thanks konsolebox