Linux – How to scan multiple directories with clamav

clamavlinuxUbuntu

I know how to scan one directory:

clamscan -r /home

but for the life of me I cannot seem to get multiple directories working and I cannot seem to Google this simple problem.

I have tried:

clamscan -r /home /otherdir
clamscan -r /home,/otherdir

to no avail.

What am I doing wrong?

Best Answer

You have to put the list of folders/files in a text file and pass it to clamscan using -f.

Example:
clamscan -r -z -i --bell --file-list=/home/nav/ClamScanTheseFolders.txt