Skip to content
FeaturesPricingBlogDownload

← All posts

How to search across a folder of Markdown files

To search Markdown files across a folder, use your editor's find in folder, grep or ripgrep in a terminal, or OS search. Commands, filters and tips for notes.

Diagram card on a light background showing a folder-wide search for pricing listing matches across three Markdown files

To search Markdown files across a whole folder, you have three good options: your editor's find-in-folder search, grep or ripgrep in a terminal, or your operating system's search. Because .md files are plain text, all three read them directly, with no index or database to build first. Editor search is the most comfortable, ripgrep is the most precise, and OS search is useful when you do not know which folder the note is in.

This guide shows each one with commands you can copy, then a few searches that are especially useful in a notes folder. Tool details come from each project's documentation, read in November 2026.

Which search method should you use?

Method Good for Strengths Limits
Editor find in folder Everyday searching while you write Click a result to open the note at that line Only searches the folder the editor has open
grep Any Mac or Linux machine, no install Available everywhere, scriptable Slower on large folders, searches hidden folders too
ripgrep (rg) Large folders, regular expressions, filters Skips .git and ignored files by default, file type filters A separate install
OS search (Spotlight, Windows Search) Finding a note when you forgot where it is Searches the whole disk from one box Content indexing of .md depends on settings

How do you search Markdown files from the command line?

grep is built into macOS and Linux. Run these from inside your notes folder:

# Every line containing "invoice", ignoring case, with file names and line numbers
grep -rin "invoice" --include='*.md' .

# Only the names of files that mention "invoice"
grep -ril "invoice" --include='*.md' .

The flags, as the GNU grep manual describes them: -r searches recursively, -i ignores case, -n prints line numbers, -l prints only file names, and --include limits the search to files matching a pattern. One thing to know: grep -r also descends into hidden folders such as .git or .obsidian, so add --exclude-dir=.git if those results get in the way.

How do you search Markdown notes with ripgrep?

ripgrep is a command-line search tool built for exactly this. Its README says: "By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files." For a notes folder that means .git, .obsidian and other dot-folders stay out of the results without any extra flags.

# Search every Markdown file, ignoring case
rg -i "invoice" -t md

# Just the file names
rg -il "invoice" -t md

# Two lines of context around each match
rg -i -C 2 "invoice" -t md

# Only notes inside the meetings folder
rg -i "invoice" -g 'meetings/**'

# Include hidden folders after all
rg -i "invoice" --hidden

-t md uses ripgrep's built-in Markdown file type, which covers .md, .markdown, .mdown, .mdwn, .mkd, .mkdn and .mdx. -g takes a glob, -C adds context lines, and --hidden turns off the hidden-file filter. ripgrep is available through Homebrew, winget, Chocolatey and most Linux package managers; the README lists the commands for each.

ripgrep treats the search term as a regular expression by default. To search for text with special characters, such as - [ ], add -F for a fixed-string search.

How do you search a folder in your Markdown editor?

Most editors that open a folder have a search across all its files, usually on Cmd+Shift+F on a Mac and Ctrl+Shift+F on Windows and Linux.

  • VS Code. The Search view opens with Cmd+Shift+F or Ctrl+Shift+F. Two boxes under the search field take files to include and exclude, such as *.md or archive/**. VS Code's documentation says it "uses the ripgrep (rg) tool to perform fast workspace searches," and that with no folder open it searches only open files.
  • Obsidian. Search opens with Cmd+Shift+F or Ctrl+Shift+F and supports operators such as file:, path:, tag:, line:, section: and task: (Obsidian search help). path:meetings invoice limits the search to one folder.
  • Typora. With a folder open, Cmd+Shift+F or Ctrl+Shift+F opens global search in the sidebar (Typora file management).
  • Zettlr. Its global full-text search, Cmd+Shift+F or Ctrl+Shift+F, can be limited to one folder (Zettlr search docs).

Editor search has one advantage the terminal does not: a click on a result opens the note at the match, so search turns straight into editing.

Can Spotlight or Windows Search find text inside .md files?

Sometimes. Check on your own machine before you rely on it.

On a Mac, mdfind queries the Spotlight index from the terminal, and -onlyin limits it to one folder:

mdfind -onlyin ~/Notes "invoice"

If a phrase you know is inside a note returns nothing, Spotlight is not indexing the contents of that file type on your Mac, and grep or an editor search is the reliable route. Apple does not document how Spotlight treats .md files, so we do not make a claim either way.

On Windows, the search index can store contents or only properties for each file type. Microsoft's indexing FAQ explains the setting: open Indexing Options, choose Advanced, then the File Types tab, select md, and choose to index properties and file contents. The notes folder also has to be one of the indexed locations.

What are useful searches in a notes folder?

A notes folder has patterns that code does not, and a few searches come up again and again:

# Open to-do items across all notes
rg -F -- "- [ ]" -t md

# Notes tagged #project in the text
rg "#project\b" -t md

# Notes whose front matter says status: draft
rg "^status: draft" -t md

# Every link to a file you are about to rename
rg -F "launch-plan.md" -t md

# Notes that mention two words anywhere, not necessarily on one line
rg -il "budget" -t md | xargs rg -il "2027"

The rename search matters most. When you rename or move a note, links that point to its old name break silently. Search for the old file name first and fix every hit in the same sitting. How to organize Markdown notes covers naming files so they stay easy to find and link.

If you search the same folder many times a day, save the commands as shell aliases, or keep them in a note of their own.

Searching a notes folder in Noteline

In Noteline, which we make, open the folder with File > Open Folder… and press Cmd+Shift+F on a Mac or Ctrl+Shift+F on Windows and Linux for Find in Folder. It searches the notes in the folder and its subfolders, lists up to 50 matching notes with a short snippet around the match, and opens a note when you click its result; Cmd+F or Ctrl+F then finds the term inside it. Hidden folders such as .git and .obsidian are skipped.

It matches plain text and ignores case. It does not take regular expressions, filters by folder or search operators, so for those, run rg on the same folder; the files are ordinary .md, and every tool here reads the same thing. Local Markdown files in Noteline covers the rest of what the app does with a folder.

Common questions

Why does grep find matches inside .git or .obsidian?

grep -r searches every folder, including hidden ones. Add --exclude-dir=.git --exclude-dir=.obsidian, or use rg, which skips hidden folders by default.

Is there a search that finds notes by meaning rather than exact words?

Not with these tools. Every method here matches the text you type. To find notes by topic, use consistent tags or front matter fields that you can search for exactly.

Start with one note. Keep the file.

Open a folder and write. Every note is a plain .md file, with no account to create.

Try desktop free for 14 days ↓Free on iPhone, iPad and Android →

Desktop: 14-day trial, then $9.99 once. Mobile apps: free. No account.

Keep reading

  • Local Markdown files
  • How to keep AI meeting notes as Markdown files you own
  • AI memory files: what your assistant should remember, kept in Markdown
  • An AI research workflow in Markdown: sources, summaries and claims

A Markdown note editor with everything you need

We’re listening

Tell us what you need or what gets in your way. If something isn’t working, write to us any time.

contact@noteline.io→

Product

  • Download
  • Pricing
  • Features
  • Changelog

Learn

  • Markdown syntax
  • Use cases
  • Blog

Compare

  • vs Obsidian
  • vs Notion

Support

  • Help
  • Support
  • Privacy
  • Terms

© 2026 Notelinecontact@noteline.io