Reveal a file in Finder with open -R

The -R flag of the open command opens a Finder window with the target file selected and highlighted — the command-line equivalent of 'Reveal in Finder', even for paths Finder normally hides.

macOSrevealFinderopenLow risk
Run `open -R path/to/file` to open the containing Finder window with that file already selected.

01Command

Command
$ open -R ~/Library/Preferences/com.apple.dock.plist
open -R ~/Projects

02What it does

Without -R, open launches the file in its default app; with it, Finder opens the parent folder and highlights the item instead. This is especially useful for deep library paths such as ~/Library that are cumbersome to navigate by hand, and it works on folders too (selecting the folder inside its parent).

03Risk

RiskLow risk
!Warning: For dot-prefixed files like .zshrc, Finder reveals the file but its parent may show nothing else visible; the selection still appears.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Files & Folders

06Related solutions