Linux is far more secure and less vulnerable to virus in compare to windows based operating system. Despite of being less vulnerable, it’s always better to clean your system often. In this tutorial, we will provide you some method to clean virus by command line in Ubuntu.
There are number of anti-virus software available for linux based operating system. Out of many of them, ClamAv is one of the popular and effective antivirus for linux. It will even let you to scan your linux through command line. Hence, we will use this antivirus to clean virus by command line in ubuntu operating system.
You can follow this command if you are linux mint user too.
Clean Virus By Command Line In Ubuntu
At first we will install ClamAV ( Popular antivirus software for linux).
sudo apt-get install clamav
Updating ClamAV Virus Database
After installing, you need to update the ClamAv virus database.
Don’t forget to stop the Clamav before updating the virus database.
sudo /etc/init.d/clamav-freshclam stop
Scanning File System using ClamAV Command Line
Now, it’s time to scan and clean your ubuntu operating system.
clamscan -i -r ~/
Above command will order ClamAV to scan and list only the infected files from home directory.
You can use the following command to remove the virus immeditely after detecting it.:
clamscan --remove=yes -i -r ~/
Enjoy and don’t forget to like and share.