---
title: "Search operators for notes: tag:, folder:, quotes and -word"
author: Pedro Thomaz
source: https://coffeetext.app/blog/search-operators-markdown-notes
---

# Search operators for notes: tag:, folder:, quotes and -word

> Checked November 2026 against [Obsidian's Search help](https://obsidian.md/help/plugins/search). I make Coffee, so weigh what I say about it. Coffee isn't affiliated with Obsidian.

Plain search is fine until a word turns up in two hundred notes. Then you want to say more: only the notes tagged work, only the ones in the Trips folder, these words together, not the drafts. Four small filters cover nearly all of that, and most note apps spell them much the same way.

## The four that matter

| You want | Write | Finds |
|---|---|---|
| Notes with a tag | `tag:work` | Notes tagged work |
| Notes in a folder | `folder:Trips` | Notes inside Trips |
| Words together, in order | `"rent increase"` | That phrase, not the words apart |
| Leave notes out | `-draft` | Notes that don't say draft |

They combine with plain words in any order. `plan tag:work -draft` finds notes tagged work that mention plan and don't say draft.

## In Coffee

Press ⌘K, or choose Note › Search All Notes, and type. Results update with each letter and ignore accents, so `cafe` finds `café`. On the Mac, the filters work as in the table:

- `tag:work` keeps notes with that tag, or a tag inside it, such as `work/meetings`.
- `folder:Trips` keeps notes in that folder, at any depth. Put quotes around a name with spaces: `folder:"Old notes"`.
- `"exact phrase"` finds those words together, in that order.
- `-draft` leaves out notes with that word.

Filters alone work too: `tag:work` on its own lists every note with that tag, newest first. Choosing a result opens the note where your words are, with them selected, not at the top.

**Jumping to a heading.** Under the notes, ⌘K lists headings with your words in them, with the note each is in. Choose one and the note opens at that heading. Start with `#` and a space, as in `# packing`, to see only headings. In a library of long notes this is often quicker than finding the note and then scrolling.

**Keeping a search.** Type a search, filters and all, and press ⌘S. It's saved in the sidebar and its list stays current as your notes change. A saved `tag:client -invoice` is a standing list of client notes that aren't invoices.

Search runs on your Mac and nothing you type is sent anywhere. The details are in [Coffee's help on search](https://coffeetext.app/help/search).

## In Obsidian

[Obsidian's search](https://obsidian.md/help/plugins/search) uses the same ideas with a few more operators:

- `tag:` for a tag, and `path:` for text in a file's path, which does the job of a folder filter. `file:` matches the file name.
- Quotes for an exact phrase, and `-` to leave a word or expression out.
- `OR` between terms for either one.
- `line:` and `section:` for words on the same line, or in the same section between two headings.
- `/.../` for a regular expression.
- `[property]` for notes with a property, and `[property:value]` for a value.

So if you move between the two apps, `tag:`, quotes and `-` carry over as they are, and `folder:` in Coffee is `path:` in Obsidian.

## In Terminal

For a folder of Markdown files without any app, `grep` covers the same ground, a little more wordily. From your notes folder:

```
grep -rl --include='*.md' 'rent increase' .
```

lists the files with that phrase. Add `-i` to ignore case. To leave some out, pipe the list through a second grep with `-L`:

```
grep -rl --include='*.md' 'plan' . | xargs grep -L 'draft'
```

That gives the files that mention plan and don't say draft. For a folder filter, start the search in that folder. A tag is just text, so `grep -rl '#work' .` finds it, though it also matches `#workshop`.

The [Spotlight and Quick Look guide](https://coffeetext.app/blog/find-markdown-notes-spotlight-quick-look) covers the Mac's own search, which finds notes without opening any app at all.

## Making filters pay off

Filters only help if the notes carry something to filter on. Two habits do most of it:

- **Tag what crosses folders.** A client, a project or a status that appears in notes all over the library is a tag. [Folders or tags](https://coffeetext.app/blog/folders-or-tags-markdown-notes) goes through when each suits, and [nested tags](https://coffeetext.app/blog/nested-tags-markdown-notes) how `#work/acme` keeps them in order.
- **Write the word you'll search for.** If you'll look for "invoice", write "invoice" in the note, not only "bill". Search finds words, not meanings.

## Questions

### How do I search notes by tag?

In Coffee, type `tag:` and the tag in ⌘K search, such as `tag:work`. It includes the tags nested inside it. Obsidian uses the same `tag:` operator.

### How do I exclude a word from a search?

Put a minus before it: `-draft` leaves out notes with that word. It works in Coffee and Obsidian.

### Can I search only inside one folder?

Yes. In Coffee, `folder:Trips` keeps notes in that folder and the folders inside it. Put quotes around a name with spaces. In Obsidian, use `path:`.

### How do I jump to a heading in another note?

In Coffee, ⌘K lists matching headings under the notes. Choose one and the note opens there. Start with `#` and a space to see only headings.

Search filters and heading search are in Coffee on the Mac, on macOS 15 or later. It's free for 14 days without a card, then €3 a month, €29 a year, or €79 once with two years of updates.

---

Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later, and for iPhone and iPad. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at https://coffeetext.app/llms-full.txt
