How to exclude .jpg, .jpeg, .png, .gif from a ClamAV Scan (clamscan)

7,281
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, and .gif.

Share:
7,281

Related videos on Youtube

Rui F Ribeiro
Author by

Rui F Ribeiro

Updated on September 18, 2022

Comments

  • Rui F Ribeiro
    Rui F Ribeiro almost 2 years

    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.

  • Luka
    Luka about 5 years
    is it case sensitive?
  • Luka
    Luka about 5 years
    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.