find file

I want to find files which includes string of "kernel32.dll". I use grep and find commands
but ı can't solve the problem. please reply my message.
 
I want file which includes "kernel32.dll" and I want to delete those files. And I have to do this with shell programming
 
In fact I want to delete virus files in my flash memory by shell prog.
my codes is

Code:
cd /mnt

a=`grep -i kernel32.dll *`
find "$a" /mnt -type f > /home/cashua/file.sh
this code doesn't work. it writes all file names in file.sh
And I want to delete those files in list of file.sh
 
cashua66 said:
I want to delete which file includes the string "kernell32.dll". Not file name kernel32.dll. Please help.

You may have noticed that many of us are kind of tiptoeing around the subject without just handing you the answer. That's because just giving the answer really doesn't do anyone any favors. It's better to help you learn how to do it, and how to look it up.

That said, here's a hint:
% man find | less +/-exec
 
cashua66 said:
I want to delete which file includes the string "kernell32.dll". Not file name kernel32.dll. Please help.
Repeating again.
Code:
find /mnt/flash -name '*kernel32.dll*' -delete

2 Other forum people: stop using KDE4/QT4/sed/awk/grep/less/exec/sudo/named/httpd/`ls /bin/` or other random thing you use. This elementary thing can be done with 1 command.
 
Duh if hes talking about file's content then
Code:
grep -lr "kernell32.dll" /mnt/flash | xargs -n 5 rm -rf
Note: if there is 2 "l" letters before "32.dll", then nvm.. otherwise this command can delete *.exe and *.dll !
 
Back
Top