ClamAV clamscan notes

Scan for viruses

To run a scan for viruses, use the clamscan program.

This will recursively scan some/directory:

clamscan -i -r some/directory
To only show infected files. If you don’t do this you’ll get a list of every scanned file.
Recursive scanning.


bpc tmp # clamscan -r -i clamscan-test/
clamscan-test/ 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.

Last modified: 29/03/2016 Tags: ,

Related Pages

Other pages possibly of interest:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top