Linux command
clamav 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Scan a file
clamscan [path/to/file]
Scan a directory recursively
clamscan -r [path/to/directory]
Scan and remove
clamscan -r --remove [path/to/directory]
Scan and move
clamscan -r --move=[path/to/quarantine] [path/to/directory]
Scan with verbose output
clamscan -r -i -v [path/to/directory]
Update virus definitions
sudo freshclam
Scan using the daemon
clamdscan [path/to/file]
说明
ClamAV is an open-source antivirus engine for detecting trojans, viruses, malware, and other malicious threats. The suite includes clamscan for on-demand scanning, clamd as a multi-threaded daemon, clamdscan for daemon-based scanning, and freshclam for automatic signature updates. ClamAV is widely used in mail gateway scanning, particularly on Unix-based systems. It supports scanning of archives (ZIP, RAR, TAR, GZIP), documents (PDF, Office formats), executables, and many other file types. The signature database is maintained by Cisco Talos and updated multiple times daily. For high-volume scanning, running the clamd daemon provides significantly better performance than repeated clamscan invocations, as it keeps the signature database loaded in memory.
参数
- -r, --recursive
- Scan directories and their subdirectories recursively.
- -i, --infected
- Only print infected files in the output.
- --remove
- Remove infected files. Use with caution.
- --move=_DIR_
- Move infected files to the specified quarantine directory.
- --copy=_DIR_
- Copy infected files to the specified directory.
- -v, --verbose
- Be verbose during scanning.
- -l _FILE_, --log=_FILE_
- Save scan report to the specified file.
- --bell
- Sound bell on virus detection.
- --exclude=_REGEX_
- Exclude files matching the regular expression.
- --include=_REGEX_
- Only scan files matching the regular expression.
- --max-filesize=_SIZE_
- Skip files larger than the specified size (default 100M).
- -h, --help
- Display help information.
FAQ
What is the clamav command used for?
ClamAV is an open-source antivirus engine for detecting trojans, viruses, malware, and other malicious threats. The suite includes clamscan for on-demand scanning, clamd as a multi-threaded daemon, clamdscan for daemon-based scanning, and freshclam for automatic signature updates. ClamAV is widely used in mail gateway scanning, particularly on Unix-based systems. It supports scanning of archives (ZIP, RAR, TAR, GZIP), documents (PDF, Office formats), executables, and many other file types. The signature database is maintained by Cisco Talos and updated multiple times daily. For high-volume scanning, running the clamd daemon provides significantly better performance than repeated clamscan invocations, as it keeps the signature database loaded in memory.
How do I run a basic clamav example?
Run `clamscan [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, --recursive do in clamav?
Scan directories and their subdirectories recursively.