8 **notmuch** **count** [*option* ...] <*search-term*> ...
13 Count messages matching the search terms.
15 The number of matching messages (or threads) is output to stdout.
17 With no search terms, a count of all messages (or threads) in the
18 database will be displayed.
20 See **notmuch-search-terms(7)** for details of the supported syntax for
23 Supported options for **count** include
25 ``--output=(messages|threads|files)``
28 Output the number of matching messages. This is the default.
31 Output the number of matching threads.
34 Output the number of files associated with matching
35 messages. This may be bigger than the number of matching
36 messages due to duplicates (i.e. multiple files having the
39 ``--exclude=(true|false)``
40 Specify whether to omit messages matching search.tag\_exclude
41 from the count (the default) or not.
44 Read queries from a file (stdin by default), one per line, and
45 output the number of matching messages (or threads) to stdout,
46 one per line. On an empty input line the count of all messages
47 (or threads) in the database will be output. This option is not
48 compatible with specifying search terms on the command line.
50 ``--input=``\ <filename>
51 Read input from given file, instead of from stdin. Implies
57 **notmuch(1)**, **notmuch-config(1)**, **notmuch-dump(1)**,
58 **notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
59 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
60 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**