docs/man/clamscan.1.in
4f4b8d1f
 .TH "clamscan" "1" "December 4, 2013" "ClamAV @VERSION@" "Clam AntiVirus"
28e73e95
 .SH "NAME"
6e17eb5e
 .LP
f3a638e4
 clamscan \- scan files and directories for viruses
28e73e95
 .SH "SYNOPSIS"
6e17eb5e
 .LP
28e73e95
 clamscan [options] [file/directory/\-]
 .SH "DESCRIPTION"
6e17eb5e
 .LP
f3a638e4
 clamscan is a command line anti\-virus scanner.
28e73e95
 .SH "OPTIONS"
6e17eb5e
 .LP
269d520d
 Most of the options are simple switches which enable or disable some features. Options marked with [=yes/no(*)] can be optionally followed by =yes/=no; if they get called without the boolean argument the scanner will assume 'yes'. The asterisk marks the default internal setting for a given option.
6e17eb5e
 .TP
28e73e95
 \fB\-h, \-\-help\fR
a9ebff44
 Print help information and exit.
6e17eb5e
 .TP
28e73e95
 \fB\-V, \-\-version\fR
a9ebff44
 Print version number and exit.
6e17eb5e
 .TP
28e73e95
 \fB\-v, \-\-verbose\fR
5def21ff
 Be verbose.
4f4b8d1f
 .TP
 \fB\-a, \-\-archive\-verbose\fR
 Show filenames inside scanned archives
6e17eb5e
 .TP
5def21ff
 \fB\-\-debug\fR
f3a638e4
 Display debug messages from libclamav.
6e17eb5e
 .TP
28e73e95
 \fB\-\-quiet\fR
a9ebff44
 Be quiet (only print error messages).
6e17eb5e
 .TP
28e73e95
 \fB\-\-stdout\fR
8589f1a0
 Write all messages (except for libclamav output) to the standard output (stdout).
4f4b8d1f
 .TP
 \fB\-\-no\-summary\fR
 Do not display summary at the end of scanning.
 .TP
 \fB\-i, \-\-infected\fR
 Only print infected files.
 .TP
 \fB\-o, \-\-suppress\-ok\-results\fR
 Skip printing OK files
 .TP
 \fB\-\-bell\fR
 Sound bell on virus detection.
 .TP
 \fB\-\-tempdir=DIRECTORY\fR
 Create temporary files in DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
 .TP
 \fB\-\-leave\-temps\fR
 Do not remove temporary files.
6e17eb5e
 .TP
e098cdc5
 \fB\-\-gen\-json\fR
 Generate JSON description of scanned file(s). JSON will be printed and also dropped to the temp directory if --leave-temps is enabled.
6e17eb5e
 .TP
28e73e95
 \fB\-d FILE/DIR, \-\-database=FILE/DIR\fR
a9ebff44
 Load virus database from FILE or load all virus database files from DIR.
6e17eb5e
 .TP
208ceae5
 \fB\-\-official\-db\-only=[yes/no(*)]\fR
 Only load the official signatures published by the ClamAV project.
6e17eb5e
 .TP
28e73e95
 \fB\-l FILE, \-\-log=FILE\fR
a9ebff44
 Save scan report to FILE.
6e17eb5e
 .TP
28e73e95
 \fB\-r, \-\-recursive\fR
a9ebff44
 Scan directories recursively. All the subdirectories in the given directory will be scanned.
6e17eb5e
 .TP
1feaa72a
 \fB\-z, \-\-allmatch\fR
 After a match, continue scanning within the file for additional matches.
6e17eb5e
 .TP
2086dc5c
 \fB\-\-cross\-fs=[yes(*)/no]\fR
 Scan files and directories on other filesystems.
6e17eb5e
 .TP
8c57a6c1
 \fB\-\-follow\-dir\-symlinks=[0/1(*)/2]\fR
3bf5b5bd
 Follow directory symlinks. There are 3 options: 0 - never follow directory symlinks, 1 (default) - only follow directory symlinks, which are passed as direct arguments to clamscan. 2 - always follow directory symlinks.
6e17eb5e
 .TP
8c57a6c1
 \fB\-\-follow\-file\-symlinks=[0/1(*)/2]\fR
3bf5b5bd
 Follow file symlinks. There are 3 options: 0 - never follow file symlinks, 1 (default) - only follow file symlinks, which are passed as direct arguments to clamscan. 2 - always follow file symlinks.
6e17eb5e
 .TP
4f4b8d1f
 \fB\-f FILE, \-\-file\-list=FILE\fR
 Scan files listed line by line in FILE.
6e17eb5e
 .TP
269d520d
 \fB\-\-remove[=yes/no(*)]\fR
4f4b8d1f
 Remove infected files. \fBBe careful!\fR
6e17eb5e
 .TP
28e73e95
 \fB\-\-move=DIRECTORY\fR
a39ae468
 Move infected files into DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
6e17eb5e
 .TP
f3a638e4
 \fB\-\-copy=DIRECTORY\fR
a39ae468
 Copy infected files into DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
6e17eb5e
 .TP
4f4b8d1f
 \fB\-\-exclude=REGEX, \-\-exclude\-dir=REGEX\fR
 Don't scan file/directory names matching regular expression. These options can be used multiple times.
6e17eb5e
 .TP
4f4b8d1f
 \fB\-\-include=REGEX, \-\-include\-dir=REGEX\fR
 Only scan file/directory matching regular expression. These options can be used multiple times.
6e17eb5e
 .TP
c4910836
 \fB\-\-bytecode[=yes(*)/no]\fR
 With this option enabled ClamAV will load bytecode from the database. It is highly recommended you keep this option turned on, otherwise you may miss detections for many new viruses.
6e17eb5e
 .TP
62315ce6
 \fB\-\-bytecode\-unsigned[=yes/no(*)]\fR
cd2f2975
 Allow loading bytecode from outside digitally signed .c[lv]d files. **Caution**: You should NEVER run bytecode signatures from untrusted sources. Doing so may result in arbitrary code execution.
6e17eb5e
 .TP
50b0bd80
 \fB\-\-bytecode\-timeout=N\fR
a6165cd4
 Set bytecode timeout in milliseconds (default: 5000 = 5s)
6e17eb5e
 .TP
c94a95b8
 \fB\-\-statistics[=none(*)/bytecode/pcre]\fR
 Collect and print execution statistics.
6e17eb5e
 .TP
269d520d
 \fB\-\-detect\-pua[=yes/no(*)]\fR
70edb085
 Detect Possibly Unwanted Applications.
6e17eb5e
 .TP
c657d4d8
 \fB\-\-exclude\-pua=CATEGORY\fR
964a1e73
 Exclude a specific PUA category. This option can be used multiple times. See https://www.clamav.net/documents/potentially-unwanted-applications-pua for the complete list of PUA
6e17eb5e
 .TP
c657d4d8
 \fB\-\-include\-pua=CATEGORY\fR
964a1e73
 Only include a specific PUA category. This option can be used multiple times. See https://www.clamav.net/documents/potentially-unwanted-applications-pua for the complete list of PUA
6e17eb5e
 .TP
269d520d
 \fB\-\-detect\-structured[=yes/no(*)]\fR
 Use the DLP (Data Loss Prevention) module to detect SSN and Credit Card numbers inside documents/text files.
6e17eb5e
 .TP
5fe6e72b
 \fB\-\-structured\-ssn\-format=X\fR
3f9918e1
 X=0: search for valid SSNs formatted as xxx-yy-zzzz (normal); X=1: search for valid SSNs formatted as xxxyyzzzz (stripped); X=2: search for both formats. Default is 0.
6e17eb5e
 .TP
5fe6e72b
 \fB\-\-structured\-ssn\-count=#n\fR
57e1a05e
 This option sets the lowest number of Social Security Numbers found in a file to generate a detect (default: 3).
6e17eb5e
 .TP
5fe6e72b
 \fB\-\-structured\-cc\-count=#n\fR
57e1a05e
 This option sets the lowest number of Credit Card numbers found in a file to generate a detect (default: 3).
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-mail[=yes(*)/no]\fR
ac090cf5
 Scan mail files. If you turn off this option, the original files will still be scanned, but without parsing individual messages/attachments.
6e17eb5e
 .TP
269d520d
 \fB\-\-phishing\-sigs[=yes(*)/no]\fR
f61e92da
 Enable email signature-based phishing detection.
6e17eb5e
 .TP
269d520d
 \fB\-\-phishing\-scan\-urls[=yes(*)/no]\fR
f61e92da
 Enable URL signature-based phishing detection (Phishing.Heuristics.Email.*)
 .TP
 \fB\-\-heuristic\-alerts[=yes(*)/no]\fR
 In some cases (eg. complex malware, exploits in graphic files, and others), ClamAV uses special algorithms to provide accurate detection. This option can be used to control the algorithmic detection.
e9d3861e
 .TP
269d520d
 \fB\-\-heuristic\-scan\-precedence[=yes/no(*)]\fR
7f0d1148
 Allow heuristic match to take precedence. When enabled, if a heuristic scan (such as phishingScan) detects a possible virus/phish it will stop scan immediately. Recommended, saves CPU scan-time. When disabled, virus/phish detected by heuristic scans will be reported only at the end of a scan. If an archive contains both a heuristically detected  virus/phish, and a real malware, the real malware will be reported Keep this disabled if you intend to handle "*.Heuristics.*" viruses  differently from "real" malware. If a non-heuristically-detected virus (signature-based) is found first,  the scan is interrupted immediately, regardless of this config option.
e9d3861e
 .TP
ce6becd5
 \fB\-\-normalize[=yes(*)/no]\fR
6e17eb5e
 Normalize (compress whitespace, downcase, etc.) html, script, and text files. Use normalize=no for yara compatibility.
 .TP
269d520d
 \fB\-\-scan\-pe[=yes(*)/no]\fR
ac090cf5
 PE stands for Portable Executable \- it's an executable file format used in all 32\-bit versions of Windows operating systems. By default ClamAV performs deeper analysis of executable files and attempts to decompress popular executable packers such as UPX, Petite, and FSG. If you turn off this option, the original files will still be scanned but without additional processing.
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-elf[=yes(*)/no]\fR
ac090cf5
 Executable and Linking Format is a standard format for UN*X executables. This option controls the ELF support. If you turn it off, the original files will still be scanned but without additional processing.
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-ole2[=yes(*)/no]\fR
ac090cf5
 Scan Microsoft Office documents and .msi files. If you turn off this option, the original files will still be scanned but without additional processing.
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-pdf[=yes(*)/no]\fR
ac090cf5
 Scan within PDF files. If you turn off this option, the original files will still be scanned, but without decoding and additional processing.
4f4b8d1f
 .TP
 \fB\-\-scan\-swf[=yes(*)/no]\fR
 Scan SWF files. If you turn off this option, the original files will still be scanned but without additional processing.
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-html[=yes(*)/no]\fR
ac090cf5
 Detect, normalize/decrypt and scan HTML files and embedded scripts. If you turn off this option, the original files will still be scanned, but without additional processing.
6e17eb5e
 .TP
ea9ffd29
 \fB\-\-scan\-xmldocs[=yes(*)/no]\fR
 Scan xml-based document files supported by libclamav. If you turn off this option, the original files will still be scanned, but without additional processing.
6e17eb5e
 .TP
ea9ffd29
 \fB\-\-scan\-hwp3[=yes(*)/no]\fR
 Scan HWP3 files. If you turn off this option, the original files will still be scanned, but without additional processing.
6e17eb5e
 .TP
269d520d
 \fB\-\-scan\-archive[=yes(*)/no]\fR
ac090cf5
 Scan archives supported by libclamav. If you turn off this option, the original files will still be scanned, but without unpacking and additional processing.
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-broken[=yes/no(*)]\fR
 Alert on broken executable files (PE & ELF).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-encrypted[=yes/no(*)]\fR
 Alert on encrypted archives and documents (encrypted .zip, .7zip, .rar, .pdf).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-encrypted-archive[=yes/no(*)]\fR
 Alert on encrypted archives (encrypted .zip, .7zip, .rar, .pdf).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-encrypted-doc[=yes/no(*)]\fR
 Alert on encrypted documents (encrypted .zip, .7zip, .rar, .pdf).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-macros[=yes/no(*)]\fR
 Alert on OLE2 files containing VBA macros (Heuristics.OLE2.ContainsMacros).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-exceeds\-max[=yes/no(*)]\fR
 Alert on files that exceed max file size, max scan size, or max recursion limit (Heuristics.Limits.Exceeded).
6e17eb5e
 .TP
f61e92da
 \fB\-\-alert\-phishing\-ssl[=yes/no(*)]\fR
 Alert on emails containing SSL mismatches in URLs (might lead to false positives!).
 .TP
 \fB\-\-alert\-phishing\-cloak[=yes/no(*)]\fR
 Alert on emails containing cloaked URLs (might lead to some false positives).
 .TP
 \fB\-\-alert\-partition\-intersection[=yes/no(*)]\fR
 Detect partition intersections in raw disk images using heuristics.
6e17eb5e
 .TP
 \fB\-\-max\-scantime=#n\fR
 The maximum time to scan before giving up. The value is in milliseconds. The value of 0 disables the limit. This option protects your system against DoS attacks (default: 120000 = 120s or 2min)
 .TP
4fd3c044
 \fB\-\-max\-filesize=#n\fR
4f4b8d1f
 Extract and scan at most #n bytes from each archive. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number. This option protects your system against DoS attacks (default: 25 MB, max: <4 GB)
6e17eb5e
 .TP
4fd3c044
 \fB\-\-max\-scansize=#n\fR
06e02797
 Extract and scan at most #n bytes from each archive. The size the archive plus the sum of the sizes of all files within archive count toward the scan size. For example, a 1M uncompressed archive containing a single 1M inner file counts as 2M toward max-scansize. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number. This option protects your system against DoS attacks (default: 100 MB, max: <4 GB)
4f4b8d1f
 .TP
 \fB\-\-max\-files=#n\fR
 Extract at most #n files from each scanned file (when this is an archive, a document or another kind of container). This option protects your system against DoS attacks (default: 10000)
6e17eb5e
 .TP
4fd3c044
 \fB\-\-max\-recursion=#n\fR
 Set archive recursion level limit. This option protects your system against DoS attacks (default: 16).
6e17eb5e
 .TP
5a29f422
 \fB\-\-max\-dir\-recursion=#n\fR
4e38c525
 Maximum depth directories are scanned at (default: 15).
4f4b8d1f
 
 .TP
 \fB\-\-max\-embeddedpe=#n\fR
 Maximum size file to check for embedded PE. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number (default: 10 MB, max: <4 GB).
 .TP
 \fB\-\-max\-htmlnormalize=#n\fR
 Maximum size of HTML file to normalize. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number (default: 10 MB, max: <4 GB).
 .TP
 \fB\-\-max\-htmlnotags=#n\fR
 Maximum size of normalized HTML file to scan. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number (default: 2 MB, max: <4 GB).
 .TP
 \fB\-\-max\-scriptnormalize=#n\fR
 Maximum size of script file to normalize. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number (default: 5 MB, max: <4 GB).
 .TP
067bce5f
 \fB\-\-max\-ziptypercg=#n\fR
4f4b8d1f
 Maximum size zip to type reanalyze. You may pass the value in kilobytes in format xK or xk, or megabytes in format xM or xm, where x is a number (default: 1 MB, max: <4 GB).
4b5895b8
 .TP
067bce5f
 \fB\-\-max\-partitions=#n\fR
4b5895b8
 This option sets the maximum number of partitions of a raw disk image to be scanned. This must be a positive integer (default: 50).
067bce5f
 .TP
 \fB\-\-max\-iconspe=#n\fR
 This option sets the maximum number of icons within a PE to be scanned. This must be a positive integer (default: 100).
2e10c4d7
 .TP
731c8e62
 \fB\-\-max\-rechwp3=#n\fR
 This option sets the maximum recursive calls to HWP3 parsing function (default: 16).
 .TP
877bca9b
 \fB\-\-pcre-match-limit=#n\fR
7a85da5c
 Maximum calls to the PCRE match function (default: 100000).
877bca9b
 .TP
 \fB\-\-pcre-recmatch-limit=#n\fR
f67a9b75
 Maximum recursive calls to the PCRE match function (default: 2000).
877bca9b
 .TP
 \fB\-\-pcre-max-filesize=#n\fR
 Maximum size file to perform PCRE subsig matching (default: 25 MB, max: <4 GB).
 .TP
779c0fdc
 \fB\-\-disable\-cache\fR
 Disable caching and cache checks for hash sums of scanned files.
28e73e95
 .SH "EXAMPLES"
6e17eb5e
 .LP
 .TP
f3a638e4
 (0) Scan a single file:
28e73e95
 
 \fBclamscan file\fR
6e17eb5e
 .TP
f3a638e4
 (1) Scan a current working directory:
28e73e95
 
 \fBclamscan\fR
6e17eb5e
 .TP
5def21ff
 (2) Scan all files (and subdirectories) in /home:
28e73e95
 
 \fBclamscan \-r /home\fR
6e17eb5e
 .TP
16516d51
 (3) Load database from a file:
28e73e95
 
16516d51
 \fBclamscan \-d /tmp/newclamdb \-r /tmp\fR
6e17eb5e
 .TP
f3a638e4
 (4) Scan a data stream:
28e73e95
 
 \fBcat testfile | clamscan \-\fR
6e17eb5e
 .TP
f3a638e4
 (5) Scan a mail spool directory:
28e73e95
 
9199093c
 \fBclamscan \-r /var/spool/mail\fR
28e73e95
 .SH "RETURN CODES"
6e17eb5e
 .LP
28e73e95
 0 : No virus found.
6e17eb5e
 .TP
28e73e95
 1 : Virus(es) found.
6e17eb5e
 .TP
166174bc
 2 : Some error(s) occurred.
28e73e95
 .SH "CREDITS"
 Please check the full documentation for credits.
 .SH "AUTHOR"
6e17eb5e
 .LP
4f4b8d1f
 Tomasz Kojm <tkojm@clamav.net>, Kevin Lin <klin@sourcefire.com>
28e73e95
 .SH "SEE ALSO"
6e17eb5e
 .LP
021b6720
 clamdscan(1), freshclam(1), freshclam.conf(5)