How to Install and Run ClamAV on macOS
This is a mini-HOWTO, a kind of cheatsheet to link to for myself and others looking for high information density as opposed to SEO-optimized garbage. You know the type of posts I mean.
The following instructions enable the most basic install with default options throughout. More options can be set in the conf files.
Install ClamAV with Homebrew:
brew install clamav
cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf sed -i '' 's/Example/# Example/' /usr/local/etc/clamav/freshclam.conf
freshclam several times, until there are no more updates.
cp /usr/local/etc/clamav/clamd.conf.sample /usr/local/etc/clamav/clamd.conf sed -i '' 's/Example/# Example/' /usr/local/etc/clamav/clamd.conf
Create a cronjob to automatically download new virus signatures:
@hourly /usr/local/bin/freshclam > /dev/null 2>&1