Linux: Anti-Virus Software

By Xah Lee. Date:

If you are using Linux as desktop, you might need a virus scanner. Yes, these days, you do.

On Ubuntu:

# install virus scanner
sudo apt-get install clamav

The commands are freshclam and clamscan.

Update virus database:

# update virus database:
sudo freshclam

Here's a sample output:

◆ xah@xah-p6813w◆ 2014-08-03 02:56 ◆ /media/OS/Users/xah/web
◆ sudo freshclam
[sudo] password for xah:
ClamAV update process started at Sun Aug  3 02:56:32 2014
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.98.1 Recommended version: 0.98.4
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cld is up to date (version: 19259, sigs: 1087865, f-level: 63, builder: neo)
bytecode.cvd is up to date (version: 242, sigs: 46, f-level: 63, builder: dgoddard)

Note: it might report that your ClamAV is outdated. This is because the software from apt-get is often outdated. You'll need to follow the linked FAQ and compile the binary yourself.

# scan home dir for virus. Print only infected files. Write result to file
clamscan -r -i -l "scan_result.txt" /home
# scan system dir for virus, log to file
clamscan -r -i -l scan_result.txt --exclude-dir='^/sys|^/proc|^/dev|^/lib|^/bin|^/sbin' /

see its man pages. For example, man clamscan

Linux Shell Basics

Sys Admin


Linux Desktop