Reveal in Finder from the Terminal
How do I reveal a file that I have the path for in the Terminal in Finder? I don't think that open
will work for this.
Specifically I want to be able to fzf
for a file and then pop it in Finder.
(I guess this would work if you get the path, chop off the file bit and then call open on the rest?)
How do I reveal a file that I have the path for in the Terminal in Finder? I don't think that open will work for this.
From man open
:
-R Reveals the file(s) in the Finder instead of opening them.
So, open -R /path/to/a/file.ext
will reveal your file in the Finder...
Specifically I want to be able to fzf for a file and then pop it in Finder.
In its most basic usage the following will reveal in Finder the file selected from the execution of "$(fzf)"
:
open -R "$(fzf)"
The following fzf
key bindings will map ctrl-r
to reveal the file in the Finder and ctrl-space
to a QuickLook of the file:
fzf --bind 'ctrl-r:execute(open -R {}),ctrl-space:execute-silent(qlmanage -p {})'