The general consensus is that anti virus is rarely needed on a Linux home computer:
However, you can also argue:
There are not many free and reliable anti viruses. In fact, the only one I know is ClamAV which is an Open Source AV by Cisco Inc.
Search your repository for clamav (apt, dnf or if you use Bazzite: brew)
It's all command line interface, but there is also a user interface in Flathub: ClamTk
Scanning the entire computer is overkill, especially on atomic distros like Bazzite.
Here is a setup that works for me, which will scan new files in the Downloads-folder.
scandownload.sh somewhere nicechmod +x scandownload.shThe contents of the script is:
#!/bin/bash
#Check for updates
freshclam > /dev/null
#Folder to check
DIR=$HOME/Downloads
# Get rid of old log file
rm $HOME/virus-scan.log 2> /dev/null
inotifywait -q -m -e close_write,moved_to --format '%w%f' $DIR | while read FILE
do
# Have to check file length is nonzero otherwise commands may be repeated
if [ -s $FILE ]; then
#scan the file and save the log
clamscan $FILE > $HOME/virus-scan.log
#check if the log contains text if the scan was OK
isok=$(grep -c ': OK' $HOME/virus-scan.log)
#if it was not OK, show a dialog to warn the user
if ! [ $isok ]; then
kdialog --title "Download scan" --msgbox "Virus found!" "$(cat "$HOME/virus-scan.log")"
fi
fi
done
Credit to Fitzcarraldo