Antony Mapfumo

Linux tips and tricks

Searching for files and files containing particular text


# find file(s) and delete
find . -iname "file-to-find" -exec rm -rf {} \;
# search for files containing particular text
grep -r[nw] "text-to-find" # n - print line number, w - match whole word

20 Funny Linux Commands: Linux is Fun in Terminal