How to delete all files containing string in Linux

find -type f -name '*string*' -delete

This command will delete all files whose filenames contain the string string. The * character is a wildcard that matches any number of characters. The -type f option tells find to only look for files, not directories. The -delete option tells find to delete the files it finds.