CLAMDSCAN(1)
๐ NAME ๐
okay so clamdscan โ it's the clamd client, and it scans files and directories for viruses using the Clam AntiVirus Daemon ๐ฆโจ
๐ SYNOPSIS ๐
clamdscan [options] [file/directory]
โจ DESCRIPTION โจ
so clamdscan is a clamd client, right? and you can literally use it as a clamscan replacement, no cap ๐
here's the tea tho โ it accepts all the options that are implemented in clamscan, but most of them will be ignored, because its scanning abilities only depend on clamd. like, it's not doing the work itself bestie, it's just the messenger ๐ซถ
๐ธ OPTIONS ๐ธ
-h,--helpโ show the help info and dip out. that's it. โจ-V,--versionโ print the version number and exit.-v,--verboseโ be verbose. spill the details ๐ฌ--quietโ be quiet โ only error messages get to speak. shhh ๐--stdoutโ write all messages (except for libclamav output) to the standard output (stdout).-c,--config-file=FILEโ read clamd settings from FILE.-l FILE,--log=FILEโ save the scan report to FILE.-f FILE,--file-list=FILEโ scan files listed line by line in FILE.-p A[:I],--ping A[:I]โ ping clamd up to [A] times at the optional interval [I] until it responds. like "hey are you up bestie" ๐-w,--waitโ wait up to 30 seconds for clamd to start. optionally use it alongside ping to set attempts [A] and interval [I] to check clamd.-m,--multiscanโ use multiscan mode. for local directory scans where the daemon opens paths directly, clamd attempts to scan directory contents in parallel using available threads. single files are not affected. when this option is combined with--stream, with--fdpasson a local socket, or with a quarantine action, clamdscan walks the requested paths itself and submits individual file scans while still allowing clamd to process multiple files in parallel. ๐ฅ-z,--allmatchโ after a match, keep scanning within the file for additional matches. more matches, more info, we stay nosy ๐--removeโ remove infected files. be careful. like genuinely. this deletes stuff. ๐ญ--move=DIRECTORYโ move infected files into DIRECTORY.--copy=DIRECTORYโ copy infected files into DIRECTORY.--no-summaryโ do not display the summary at the end of scanning.--reloadโ request clamd to reload the virus database. refresh her ๐-i,--infectedโ only print infected files.--fdpassโ open the file and pass the opened file descriptor to clamd. this is useful if clamd is running as a different user, or if clamd sees a different filesystem tree. this is faster than streaming the file to clamd. only available if connected to clamd via Unix/local socket. โจ--streamโ force clamdscan to send file contents to clamd instead of asking clamd to open file paths. this is generally not needed because clamdscan detects automatically if sending file contents is required. this option mostly exists for debugging and testing. in other local-socket cases,--fdpassis usually preferred.
๐ OPTION INTERACTIONS ๐
so clamdscan behavior depends first on the socket type, and then on command-line options. the way that order matters fr fr
๐ง Unix/local socket
by default, clamdscan asks the local daemon to open the paths you provide. the daemon must be able to see those paths and have permission to read them. no peeking behind the curtain bestie ๐
- with
--fdpass, clamdscan opens each file itself and passes the open file to the daemon. this is useful when the daemon runs as a different user or sees a different filesystem view. this option only works with a Unix/local socket and fd-passing support. - with
--stream, clamdscan sends file contents to the daemon instead of asking the daemon to open paths. - with
--multiscan, directory scans can use multiple daemon worker threads. if--stream,--fdpass, or a quarantine action is also used, clamdscan walks the requested paths itself and submits individual file scans while still allowing the daemon to process multiple files in parallel. --allmatchis only effective when clamdscan is asking the daemon to open paths directly and is not using--multiscan,--stream, or--fdpass.
๐ฆ TCP socket
when the daemon is remote, clamdscan sends file contents instead of local paths, because client paths may not exist on the daemon host. when the daemon is local and clamdscan can determine that it is local, clamdscan may ask the daemon to open local paths directly.
--streamforces clamdscan to send file contents, even when the daemon is local.--fdpassis not available over TCP. use either--streamor--fdpassfor a scan, based on the socket type and how the daemon can access the files.- with
--multiscan, local directory scans may use multiple daemon worker threads. remote scans,--streamscans, and scans with quarantine actions are handled as individual file scans, while still allowing the daemon to process multiple files in parallel. --allmatchis only effective when clamdscan is asking a local daemon to open paths directly and is not using--multiscanor--stream.
๐ Option guidance
--allmatch is not useful with --multiscan โ use it only for scans where clamdscan is asking a local daemon to open paths directly. for quarantine, choose one action for a scan: --move, --copy, or --remove. pick one bestie, don't be greedy ๐
๐ Quarantine actions with multiscan
quarantine actions such as --move, --copy, and --remove are performed by clamdscan, not by clamd. for directory scans with quarantine actions enabled, clamdscan resolves the action path for each file before requesting the scan. when --multiscan is also enabled, clamdscan submits individual file scans so it can preserve the scan result to action-path association while still allowing clamd to process multiple files in parallel. iconic bookkeeping honestly ๐
โญ EXAMPLES โญ
(0) to scan a one file:
clamdscan file
(1) to scan a current working directory:
clamdscan
(2) to scan all files in /home:
clamdscan /home
(3) to scan a file when clamd is running as a different user:
clamdscan --fdpass ~/downloads
(4) to scan from standard input:
clamdscan - < file_to_scan
cat file_to_scan | clamdscan -
๐ RETURN CODES ๐
0: no virus found. ๐1: virus(es) found. ๐2: an error occurred. ๐ญ
๐ CREDITS ๐
please check the full documentation for credits. they ate, lowkey ๐ซถ
๐ AUTHOR ๐
Tomasz Kojm <tkojm@clamav.net>
๐ SEE ALSO ๐
clamd(8), clamd.conf(5), clamscan(1)
okay that's the whole thing bestie, and just so you know this is ClamAV 1.5.4, dated February 12, 2009 โ the manual page is literally called Clamd client(1) and it lives under the Clam AntiVirus umbrella ๐ธ go scan something and stay safe, mwah ๐ โจ
๐ฆ where this page comes from
- arch rolling: clamav 1.5.4-1 ยท GPL-2.0-only
- nixpkgs unstable: clamav 1.5.4
- ubuntu jammy: clamdscan 1.5.4+dfsg-0ubuntu0.22.04.1 ยท GPL-2.0-only
- ubuntu noble: clamdscan 1.5.4+dfsg-0ubuntu0.24.04.1 ยท GPL-2.0-only
- ubuntu resolute: clamdscan 1.5.4+dfsg-0ubuntu0.26.04.1 ยท GPL-2.0-only
- ubuntu stonking: clamdscan 1.5.4+dfsg-0ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms