Main menu

Scan viruses with ClamAV in Linux

ClamAV is an malware scanner program and many people thinks that Linux don’t need it. But it’s very useful in my server environment. Linux mostly not affected with Virus programs but it can spread it. Most of time my wordpress installation compromised with Malicious PHP code or something someone upload a malicious files in my FileServer.

Let’s start installing ClamAV on ubuntu or CentOS.

Installing ClamAV on Ubuntu

# sudo apt-get install clamav

Installing in CentOS

# yum install epel-release
# yum install clamav

Updating signature database. (Just add sudo if you are using ubuntu systems)

# freshclam

To check all files (-r) on the computer, displaying the name of each file:

# clamscan -r /path_to_scan

Check all files and only show infected files (-i)

# clamscan -r -i /path_to_scan

To check files (-r) and ring a bell (–bell) when found something infected and show only infected files (-i)

# clamscan -r --bell -i /path_to_scan

check files(-r), show only infected files(-i) move them into qurentine directory(–move)

# clamscan -r --bell -i --move=/malicious_files  /path_to_scan

Check all files(-r and remove infected files(–remove)

# clamscan -r --remove /path_to_scan

See additional options
clamscan –help

FacebookTwitterGoogle+RSS