clamav-devel/docs/man/clamscan.1
28e73e95
 .\" Manual page created by Tomasz Kojm, 14/15 IV 2002
a36e6e5c
 .TH "clamscan" "1" "August 18, 2004" "Tomasz Kojm" "Clam AntiVirus"
28e73e95
 .SH "NAME"
 .LP 
5def21ff
 clamscan \- scan files and directories against viruses
28e73e95
 .SH "SYNOPSIS"
 .LP 
 clamscan [options] [file/directory/\-]
 .SH "DESCRIPTION"
 .LP 
a9ebff44
 clamscan is a command line anti\-virus scanner. It's a part of the Clam AntiVirus package.
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
a9ebff44
 Enable debug messages (from libclamav).
28e73e95
 .TP 
 \fB\-\-quiet\fR
a9ebff44
 Be quiet (only print error messages).
28e73e95
 .TP 
 \fB\-\-stdout\fR
a9ebff44
 Write all messages to the standard output (stdout) instead of the standard error output (stderr).
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
 Create temporary files in DIRECTORY. Directory must be writeable for the 'clamav' user or unprivileged user running clamscan.
 .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
 Disable summary printing at the end of scanning.
28e73e95
 .TP 
 \fB\-\-exclude=PATT\fR
 Don't scan file names containing PATT. It may be used multiple times.
 .TP 
 \fB\-\-include=PATT\fR
 Only scan file names containing PATT. It may be used multiple times.
 \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
 Move infected files into DIRECTORY. Directory must be writeable for the 'clamav' user or unprivileged user running clamscan.
 .TP 
a36e6e5c
 \fB\-\-no\-mail\fR
 Disable scanning of mail files.
 .TP 
a9082ea2
 \fB\-\-no\-pe\fR
 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 tries to decompress popular executable packers such as UPX. This option \fBdisables\fR PE support and is not recommended !
28e73e95
 .TP 
fb787a06
 \fB\-\-no\-ole2\fR
 Disable support for Microsoft Office document 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
a9ebff44
 Extract first #n files from each archive. This option protects your system against DoS attacks (default: 500)
28e73e95
 .TP 
 \fB\-\-max\-space=#n\fR
a9ebff44
 Extract first #n kilobytes from each archive. You may give the number in megabytes in format xM or xm, where x is a number. This option protects your system against DoS attacks (default: 10 MB)
28e73e95
 .TP 
 \fB\-\-max\-recursion=#n\fR
a9ebff44
 Set archive recursion level limit. This option protects your system against DoS attacks (default: 5).
28e73e95
 .TP 
467f8b1e
 \fB\-\-max\-ratio=#n\fR
 Set maximum archive compression ratio limit. This option protects your system against DoS attacks (default: 200).
 .TP 
28e73e95
 \fB\-\-unzip[=FULLPATH]\fR
a9ebff44
 In most cases you don't need this option \- the built\-in unarchiver will do extract Zip archives. This option however may be used as a backup for internal unpacker \- see the full documentation for more information. When enabled without an argument, unzip program will be searched in $PATH. If unzip cannot be found in $PATH, you must force it with =pathname. Remember about '=' between the option and an argument.
28e73e95
 .TP 
 \fB\-\-unrar[=FULLPATH]\fR
a9ebff44
 Scan .rar files.
28e73e95
 .TP 
 \fB\-\-unarj[=FULLPATH]\fR
a9ebff44
 Scan .arj files.
28e73e95
 .TP 
 \fB\-\-unzoo[=FULLPATH]\fR
a9ebff44
 Scan .zoo files.
28e73e95
 .TP 
 \fB\-\-lha[=FULLPATH]\fR
a9ebff44
 Scan .lzh files.
28e73e95
 .TP 
 \fB\-\-jar[=FULLPATH]\fR
a9ebff44
 clamscan uses unzip for .jar files, so optionally eventually you will need to pass a full path to unzip.
28e73e95
 .TP 
 \fB\-\-deb[=FULLPATH]\fR
 This option supports debian binary packages. Implies \-\-tgz, but doesn't conflict with \-\-tgz=FULLPATH. It requires ar utility.
 .TP 
 \fB\-\-tar[=FULLPATH]\fR
 This option supports non\-compressed archives.
 .TP 
 \fB\-\-tgz[=FULLPATH]\fR
a9ebff44
 This option supports tar.gz and .tgz files. You need GNU tar, on non\-Linux system you probably have it installed as gtar. If it's in $PATH, please use \-\-tgz=gtar in other case please pass a full path.
28e73e95
 .SH "EXAMPLES"
 .LP 
 .TP 
a9ebff44
 (0) Scan selected file:
28e73e95
 
 \fBclamscan file\fR
 .TP 
a9ebff44
 (1) Scan current working directory:
28e73e95
 
 \fBclamscan\fR
 .TP 
5def21ff
 (2) Scan all files (and subdirectories) in /home:
28e73e95
 
 \fBclamscan \-r /home\fR
 .TP 
a9ebff44
 (3) Load database from selected file and limit disk usage to 50 Mb:
28e73e95
 
5def21ff
 \fBclamscan \-d /tmp/newclamdb \-\-max\-space=50m \-r /tmp\fR
28e73e95
 .TP 
a9ebff44
 (4) Scan data stream:
28e73e95
 
 \fBcat testfile | clamscan \-\fR
 .TP 
a9ebff44
 (5) Scan mail spool directory:
28e73e95
 
 \fBclamscan \-r \-\-mbox /var/spool/mail\fR
 .SH "RETURN CODES"
 .LP 
a9ebff44
 Note: some return codes may only appear in a one file mode (clamscan is started with file 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 
a9ebff44
 58: I/O error, please check your filesystem.
28e73e95
 .TP 
 59: Can't get information about current user from /etc/passwd.
 .TP 
 60: Can't get information about user 'clamav' (default name) from /etc/passwd.
 .TP 
 61: Can't fork.
 .TP 
 63: Can't create temporary files/directories (check permissions).
 .TP 
a9ebff44
 64: Can't write to temporary directory (please specify another one).
28e73e95
 .TP 
 70: Can't allocate and clear memory (calloc).
 .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)