AERC-SEARCH(1)

🌸 aerc-search(1) β€” the search glow-up guide 🌸

okay bestie, welcome to aerc-search(1) β€” it's from the General Commands Manual section and it's literally the cheat sheet for finding stuff in aerc(1). Think of it as your group chat search bar but make it ✨powerful✨.

This page covers the filter/search patterns and options β€” the syntax works for every backend, no cap. πŸ’…


✨ SYNTAX ✨

so this syntax is common to all backends, meaning you don't gotta relearn it per backend. iconic behavior fr fr.

:filter [-rubave] [-x <flag>] [-X <flag>] [-H <header>:[<value>]] [-f <from>] [-t <to>] [-c <cc>] [-d <start[..end]>] [<terms>...]
:search [-rubave] [-x <flag>] [-X <flag>] [-H <header>:[<value>]] [-f <from>] [-t <to>] [-c <cc>] [-d <start[..end]>] [<terms>...]

Both of these search the current folder for messages matching the set of conditions you give em. 🫢

  • :filter β€” this one restricts the displayed messages to only the search results. like, it actually hides everything else. main character filtering energy.
  • :search β€” the searching one, but it doesn't hide your other messages from view the way :filter does.

Each space separated term of <terms>, if you provided any, gets searched case-insensitively among subject lines β€” unless you threw in -b or -a. πŸ’–


πŸŽ€ the options (yes, all of them)

  • -r β€” search for read messages
  • -u β€” search for unread messages
  • -x <flag>, -X <flag> β€” restrict search to messages with or without <flag>
    • use -x to search for messages with the flag set
    • use -X to search for messages without the flag set

possible values are:

  • seen β€” read messages
  • answered β€” replied messages
  • forwarded β€” forwarded messages
  • flagged β€” flagged messages
  • draft β€” draft messages
  • -H <header>:[<value>] β€” search in the headers of the messages for a specific <header> that matches <value>. <value> can be omitted to only search for a <header>. if either the <header> or the <value> contain a space then the whole argument needs to be escaped with quotes. ⚠️ note: spaces around <value> are trimmed.
  • -b β€” search in the body of the messages
  • -a β€” search in the entire text of the messages
  • -v β€” exclude messages which match this search (inverse queen πŸ‘‘)
  • -e β€” instruct the backend to use a custom search extension (such as X-GM-EXT-1 if available). search terms are expected in <terms>; other flags will be ignored. 🫑
  • -f <from> β€” search for messages from <from>
  • -t <to> β€” search for messages to <to>
  • -c <cc> β€” search for messages cc'ed to <cc>
  • -d <since[..until]> β€” search for messages within a particular date range between since and until, excluding the latter (in mathematical notation: search for messages in the [since, until) interval). until can be omitted to only search for <since> to present.

πŸ¦‹ date formats for -d (iykyk)

spaces and underscores are allowed in relative dates to improve readability. yes bestie, readability matters πŸ’–

  • YYYY-MM-DD
  • today, yesterday
  • (this|last) (year|month|week)
  • Weekdays, Monthnames β€” can also be abbreviated, so Monday..Tuesday can be written as Mon..Tue and February..March as Feb..Mar.
  • <N> (y[ear]|m[onth]|w[eek]|d[ay]) β€” <N> is a positive integer that represents the number of time units in the past. multiple relative terms can be accumulated. the units can also be abbreviated by a single letter such that yesterday would correspond to 1d (equivalent to 1 day or 1_day) and 8 days ago would be either 1w1d or 8d. 🧚

πŸ”₯ CUSTOM IMAP EXTENSIONS πŸ”₯

the Gmail IMAP extension (X-GM-EXT-1) can be used for searching and filtering. to use this custom extension, make sure it is activated (see aerc-imap(5)) and use the extension -e flag in your :filter or :search commands. slay πŸŽ€

example:

:filter -e filename:pdf from:bob
:filter -e has:attachment newer_than:2d

:search -e is:read is:starred
:search -e list:~rjarry/aerc-devel@lists.sr.ht

πŸ’œ NOTMUCH πŸ’œ

for notmuch, it is possible to avoid using the above flags and only rely on notmuch search syntax. lowkey a vibe.

:filter query...
:search query...

you can use the full notmuch query language as described in notmuch-search-terms(7). πŸ“š

the query will only apply on top of the active folder query β€” so it stacks, it doesn't replace. no cap.

example, jump to next unread:

:search tag:unread

⭐ SEE ALSO ⭐


🌈 AUTHORS 🌈

originally created by Drew DeVault and maintained by Robin Jarry who is assisted by other open source contributors. for more information about aerc development, see https://sr.ht/~rjarry/aerc/. πŸ‘‘


and that's the whole page bestie πŸ’… go forth and search, filter, and generally ate πŸ’–

β€” with love, the general commands manual, dated 2026-09-07, AERC-SEARCH(1) out. 🫢✨

πŸ“¦ where this page comes from