NOTMUCH-COUNT(1)

πŸ’… NAME πŸ’…

okay so bestie, this is notmuch-count β€” it counts messages matching the search terms you give it ✨


🌸 SYNOPSIS 🌸

notmuch count [option ...] <search-term> ...

πŸ¦‹ DESCRIPTION πŸ¦‹

It literally just counts the messages that match your search terms. That's the whole vibe. πŸ”₯

The number of matching messages (or threads) gets output to stdout. Periodt.

And if you give it no search terms at all? It'll show you a count of every message (or thread) chillin' in the database. The whole squad. πŸ’–

If you wanna know the supported syntax for <search-terms>, go peek at notmuch-search-terms β€” iykyk.

The supported options for count include:

  • --output=(messages|threads|files) β€” pick what you're counting, bestie:
    • messages β€” output the number of matching messages. This is the default, so if you don't say anything this is what you get πŸŽ€
    • threads β€” output the number of matching threads.
    • files β€” output the number of files associated with matching messages. Ngl this one can be bigger than the number of matching messages, because duplicates exist (i.e. multiple files having the same message-id). Not a glitch, just how it is πŸ’€
  • --exclude=(true|false) β€” say whether you wanna omit messages matching search.exclude_tags from the count (that's the default, true) or not. Choose wisely ✨
  • --batch β€” read queries from a file (stdin by default), one per line, and output the number of matching messages (or threads) to stdout, one per line. And on an empty input line, the count of all messages (or threads) in the database will be output. Heads up though: this option is not compatible with specifying search terms on the command line. So don't do that πŸ™ˆ
  • --lastmod β€” append lastmod (that's the counter for number of database updates) and UUID to the output. Real talk: lastmod values are only comparable between databases with the same UUID. Don't compare across different ones, it means nothing 🫢
  • --input=<filename> β€” read input from the given file instead of from stdin. This one implies --batch πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

notmuch, notmuch-config, notmuch-dump, notmuch-hooks, notmuch-insert, notmuch-new, notmuch-reply, notmuch-restore, notmuch-search, notmuch-search-terms, notmuch-show, notmuch-tag


πŸ’œ Author

Carl Worth and many others 🫢

2009-2026, Carl Worth and many others


and that's the whole page bestie ✨ version 0.40, dated Jan 31, 2026 β€” count it, love it, slay πŸ’–πŸ‘‘

πŸ“¦ where this page comes from