Skip to content

stupid way for remove infected files detected by avg

since avg 8.5 for Linux does not come with removal tool for removing infected files
you have to remove it by hand
first scan directory
avgscan /media/disk
it will come with something like that

/media/disk/watan/watan.exe Virus identified Autoit.BM
/media/disk/show/show.exe Virus identified Autoit.BM
/media/disk/ncyrf.bat Virus identified Worm/AutoRun.EQ

copy and paste output into file say example.txt
now run awk to get first field and get output to test.txt
awk '{ print $1 }' example.txt > test.txt
add rm command to beginning of each line by sed
sed -i s/^/"rm -rf "/ test.txt
why not loop …;) fear of accidental removal of important files 🙂
it should be looking like

cat test.txt
rm -rf /media/disk/watan/watan.exe
rm -rf /media/disk/show/show.exe
rm -rf /media/disk/ncyrf.bat

now
sh text .txt
hope that might be helpful