Notes

[grep] Find and Delete files based on string

Edit on GitHub


Commands
1grep -lZrw xxx-hacker /home/theitali/ | xargs -0 rm -f --

where xxx-hacker is your string and /home/theitali/ is your location.

  • l lists the file name
  • Z is required for the xargs -0 part
  • r is for recursive, try -R if small r doesnt work.
  • w is for searching the whole word