]> git.notmuchmail.org Git - notmuch/blob - doc/man1/notmuch-count.rst
Merge branch 'release'
[notmuch] / doc / man1 / notmuch-count.rst
1 =============
2 notmuch-count
3 =============
4
5 SYNOPSIS
6 ========
7
8 **notmuch** **count** [*option* ...] <*search-term*> ...
9
10 DESCRIPTION
11 ===========
12
13 Count messages matching the search terms.
14
15 The number of matching messages (or threads) is output to stdout.
16
17 With no search terms, a count of all messages (or threads) in the
18 database will be displayed.
19
20 See **notmuch-search-terms(7)** for details of the supported syntax for
21 <search-terms>.
22
23 Supported options for **count** include
24
25     ``--output=(messages|threads|files)``
26
27         **messages**
28             Output the number of matching messages. This is the default.
29
30         **threads**
31             Output the number of matching threads.
32
33         **files**
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
37             same message-id).
38
39     ``--exclude=(true|false)``
40         Specify whether to omit messages matching search.tag\_exclude
41         from the count (the default) or not.
42
43     ``--batch``
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.
49
50     ``--lastmod``
51         Append lastmod (counter for number of database updates) and UUID
52         to the output. lastmod values are only comparable between databases
53         with the same UUID.
54
55     ``--input=``\ <filename>
56         Read input from given file, instead of from stdin. Implies
57         ``--batch``.
58
59 SEE ALSO
60 ========
61
62 **notmuch(1)**, **notmuch-config(1)**, **notmuch-dump(1)**,
63 **notmuch-hooks(5)**, **notmuch-insert(1)**, **notmuch-new(1)**,
64 **notmuch-reply(1)**, **notmuch-restore(1)**, **notmuch-search(1)**,
65 **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**