Scan for viruses
To run a scan for viruses, use the clamscan
program.
This will recursively scan some/directory:
clamscan -i -r some/directory
-i
- To only show infected files. If you don’t do this you’ll get a list of every scanned file.
-r
- Recursive scanning.
E.g:
bpc tmp # clamscan -r -i clamscan-test/
clamscan-test/eicar.com: Eicar-Test-Signature FOUND
----------- SCAN SUMMARY -----------
Known viruses: 4297357
Engine version: 0.98.7
Scanned directories: 2
Scanned files: 629
Infected files: 1
Data scanned: 1.70 MB
Data read: 1.04 MB (ratio 1.64:1)
Time: 11.611 sec (0 m 11 s)
Log to file
To log the results to a file:
clamscan -i -l the-log-file.txt --quiet -r some/directory
If you don’t use the --quiet
flag then you’ll still get output on stdout.