docs/man/clamscan.1.in
a39ae468
 .TH "clamscan" "1" "February 12, 2007" "ClamAV @VERSION@" "Clam AntiVirus"
28e73e95
 .SH "NAME"
 .LP 
f3a638e4
 clamscan \- scan files and directories for viruses
28e73e95
 .SH "SYNOPSIS"
 .LP 
 clamscan [options] [file/directory/\-]
 .SH "DESCRIPTION"
 .LP 
f3a638e4
 clamscan is a command line anti\-virus scanner.
28e73e95
 .SH "OPTIONS"
 .LP 
 
 .TP 
 \fB\-h, \-\-help\fR
a9ebff44
 Print help information and exit.
28e73e95
 .TP 
 \fB\-V, \-\-version\fR
a9ebff44
 Print version number and exit.
28e73e95
 .TP 
 \fB\-v, \-\-verbose\fR
5def21ff
 Be verbose.
 .TP 
 \fB\-\-debug\fR
f3a638e4
 Display debug messages from libclamav.
28e73e95
 .TP 
 \fB\-\-quiet\fR
a9ebff44
 Be quiet (only print error messages).
28e73e95
 .TP 
 \fB\-\-stdout\fR
8589f1a0
 Write all messages (except for libclamav output) to the standard output (stdout).
28e73e95
 .TP 
 \fB\-d FILE/DIR, \-\-database=FILE/DIR\fR
a9ebff44
 Load virus database from FILE or load all virus database files from DIR.
28e73e95
 .TP 
 \fB\-l FILE, \-\-log=FILE\fR
a9ebff44
 Save scan report to FILE.
28e73e95
 .TP 
 \fB\-\-tempdir=DIRECTORY\fR
a39ae468
 Create temporary files in DIRECTORY. Directory must be writable for the '@CLAMAVUSER@' user or unprivileged user running clamscan.
28e73e95
 .TP 
a9082ea2
 \fB\-\-leave\-temps\fR
 Do not remove temporary files.
 .TP 
28e73e95
 \fB\-r, \-\-recursive\fR
a9ebff44
 Scan directories recursively. All the subdirectories in the given directory will be scanned.
28e73e95
 .TP 
a3ee0766
 \fB\-\-bell\fR
 Sound bell on virus detection.
 .TP 
 \fB\-\-no\-summary\fR
02b4b0c7
 Do not display summary at the end of scanning.
28e73e95
 .TP 
66ceca09
 \fB\-\-exclude=PATT, \-\-exclude\-dir=PATT\fR
 Don't scan file/directory names containing PATT. It may be used multiple times.
28e73e95
 .TP 
66ceca09
 \fB\-\-include=PATT, \-\-include\-dir=PATT\fR
 Only scan file/directory names containing PATT. It may be used multiple times.
ab16bae7
 .TP 
28e73e95
 \fB\-i, \-\-infected\fR
5def21ff
 Only print infected files.
28e73e95
 .TP 
 \fB\-\-remove\fR
 Remove infected files. \fBBe careful.\fR
5def21ff
 .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.
28e73e95
 .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.
f3a638e4
 .TP 
70edb085
 \fB\-\-detect\-pua\fR
 Detect Possibly Unwanted Applications.
 .TP 
c657d4d8
 \fB\-\-exclude\-pua=CATEGORY\fR
 Exclude a specific PUA category. This option can be used multiple times.
 .TP 
 \fB\-\-include\-pua=CATEGORY\fR
 Only include a specific PUA category. This option can be used multiple times.
 .TP 
5fe6e72b
 \fB\-\-detect\-structured\fR
 Enable the DLP (Data Loss Prevention) module which provides detection of SSN and Credit Card numbers.
 .TP 
 \fB\-\-structured\-ssn\-format=X\fR
 X=0: search for valid SSNs formatted as xxx-yy-zzzz (normal); X=1: search for valid SSNs formatted as xxxyyzzzz (stripped); X=2: default: search for both formats.
 .TP 
 \fB\-\-structured\-ssn\-count=#n\fR
 This option sets the lowest number of Social Security Numbers found in a file to generate a detect (default: 1).
 .TP 
 \fB\-\-structured\-cc\-count=#n\fR
 This option sets the lowest number of Credit Card numbers found in a file to generate a detect (default: 1).
 .TP 
a36e6e5c
 \fB\-\-no\-mail\fR
 Disable scanning of mail files.
 .TP 
f3a638e4
 \fB\-\-no\-phishing\-sigs\fR
 Disable signature-based phishing detection.
d6449522
 .TP 
e9d3861e
 \fB\-\-no\-phishing\-scan\-urls\fR
3fced6f7
 Disable url-based heuristic phishing detection. This disables Phishing.Heuristics.Email.*
e9d3861e
 .TP
7f0d1148
 \fB\-\-heuristic\-scan\-precedence\fR
 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
19b3e182
 \fB\-\-phishing\-ssl\fR
0518e6c1
 Always block SSL mismatches in URLs (might lead to false positives!).
19b3e182
 .TP
 \fB\-\-phishing\-cloak\fR
0518e6c1
 Always block cloaked URLs (might lead to some false positives).
19b3e182
 .TP
f3a638e4
 \fB\-\-no\-algorithmic\fR
1b661cef
 In some cases (eg. complex malware, exploits in graphic files, and others), ClamAV uses special algorithms to provide accurate detection. This option disables the algorithmic detection.
 .TP 
a9082ea2
 \fB\-\-no\-pe\fR
ab16bae7
 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. This option \fBdisables\fR PE support and should be used with care!
28e73e95
 .TP 
3f97a1e7
 \fB\-\-no\-elf\fR
 Executable and Linking Format is a standard format for UN*X executables. This option \fBdisables\fR ELF support.
 .TP 
fb787a06
 \fB\-\-no\-ole2\fR
f3a638e4
 Disable support for Microsoft Office documents and .msi files.
fb787a06
 .TP 
c5107e70
 \fB\-\-no\-pdf\fR
 Disable scanning within PDF files.
 .TP 
888f5794
 \fB\-\-no\-html\fR
 Disable support for HTML detection and normalisation.
 .TP 
a3ee0766
 \fB\-\-no\-archive\fR
28e73e95
 Disable archive support built in libclamav.
 .TP 
20c3d44d
 \fB\-\-detect\-broken\fR
 Mark broken executables as viruses (Broken.Executable).
 .TP 
5484e03c
 \fB\-\-block\-encrypted\fR
fb787a06
 Mark encrypted archives as viruses (Encrypted.Zip, Encrypted.RAR).
 .TP 
a36e6e5c
 \fB\-\-mail\-follow\-urls\fR
 If an email contains URLs ClamAV can download and scan them. \fBWARNING: This option may open your system to a DoS attack. Never use it on loaded servers.\fR
 .TP 
28e73e95
 \fB\-\-max\-files=#n\fR
4fd3c044
 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)
28e73e95
 .TP 
4fd3c044
 \fB\-\-max\-filesize=#n\fR
 Extract and scan at most #n kilobytes from each archive. You may pass the value in megabytes in format xM or xm, where x is a number. This option protects your system against DoS attacks (default: 25 MB)
28e73e95
 .TP 
4fd3c044
 \fB\-\-max\-scansize=#n\fR
 Extract and scan at most #n kilobytes from each scanned file. You may pass the value in megabytes in format xM or xm, where x is a number. This option protects your system against DoS attacks (default: 100 MB)
28e73e95
 .TP 
4fd3c044
 \fB\-\-max\-recursion=#n\fR
 Set archive recursion level limit. This option protects your system against DoS attacks (default: 16).
467f8b1e
 .TP 
5a29f422
 \fB\-\-max\-dir\-recursion=#n\fR
4e38c525
 Maximum depth directories are scanned at (default: 15).
28e73e95
 .SH "EXAMPLES"
 .LP 
 .TP 
f3a638e4
 (0) Scan a single file:
28e73e95
 
 \fBclamscan file\fR
 .TP 
f3a638e4
 (1) Scan a current working directory:
28e73e95
 
 \fBclamscan\fR
 .TP 
5def21ff
 (2) Scan all files (and subdirectories) in /home:
28e73e95
 
 \fBclamscan \-r /home\fR
 .TP 
f3a638e4
 (3) Load database from a file and limit disk usage to 50 MB:
28e73e95
 
5def21ff
 \fBclamscan \-d /tmp/newclamdb \-\-max\-space=50m \-r /tmp\fR
28e73e95
 .TP 
f3a638e4
 (4) Scan a data stream:
28e73e95
 
 \fBcat testfile | clamscan \-\fR
 .TP 
f3a638e4
 (5) Scan a mail spool directory:
28e73e95
 
9199093c
 \fBclamscan \-r /var/spool/mail\fR
28e73e95
 .SH "RETURN CODES"
 .LP 
f3a638e4
 Note: some return codes may only appear in a single file mode (when clamscan is started with a single argument). Those are marked with \fB(ofm)\fR.
28e73e95
 
 0 : No virus found.
 .TP 
 1 : Virus(es) found.
 .TP 
 40: Unknown option passed.
 .TP 
5def21ff
 50: Database initialization error.
28e73e95
 .TP 
 52: Not supported file type.
 .TP 
 53: Can't open directory.
 .TP 
 54: Can't open file. (ofm)
 .TP 
 55: Error reading file. (ofm)
 .TP 
 56: Can't stat input file / directory.
 .TP 
a9ebff44
 57: Can't get absolute path name of current working directory.
28e73e95
 .TP 
37526073
 58: I/O error, please check your file system.
28e73e95
 .TP 
932616b1
 62: Can't initialize logger.
 .TP 
28e73e95
 63: Can't create temporary files/directories (check permissions).
 .TP 
a9ebff44
 64: Can't write to temporary directory (please specify another one).
28e73e95
 .TP 
f3a638e4
 70: Can't allocate memory (calloc).
28e73e95
 .TP 
 71: Can't allocate memory (malloc).
 .SH "CREDITS"
 Please check the full documentation for credits.
 .SH "AUTHOR"
 .LP 
5def21ff
 Tomasz Kojm <tkojm@clamav.net>
28e73e95
 .SH "SEE ALSO"
 .LP 
a9ebff44
 clamdscan(1), freshclam(1)