Finding file satisfying a pattern

find {dir} -type f -name <filepattern>

Deleting files recursively from all the subdirectories

find {dir} -type d -name "subdir_name" -exec echo rm -rf {} \;

Writing text to a file from terminal

Single line

echo "Content goes here" > filename

Multi line

cat << EOF > filename
line1 
line2 
EOF