I'm running a clamscan command to scan my users home directories, I'd like to exclude images from the scan as these sites specifically have thousands of images.


clamscan --exclude='\.(jpg|jpeg|png|gif)$'

\. is the . in the file extension (jpg|jpeg|png|gif) matches any of those strings $ pins the search to the end of the line

This, therefore, should exclude all files ending in .jpg, .jpeg, .png, .gif

  • is it case sensitive? – Luka May 15 at 19:10
  • Case-Insensitive [i] Specifying the i modifier causes ClamAV to match all alphabetic hex bytes as case-insensitive. All patterns in ClamAV are case-sensitive by default. I always run with clamscan -ri haha, silly me. – Luka May 15 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.