Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using bash to navigate to a file in Finder

I drag a lot of graphic files from Finder directly into InDesign and Photoshop. I use a vey simple bash script to quickly open the directory containing the file.

cd "/Volumes/Server/Resources/stock1/"

open .

The script opens the correct directory, but I would like to know how to get it to also go to a specified file (e.g., image.eps) and highlight/select it. The directories I work with contain hundreds of files and have hard-to-look-through names. This would be a huge time-saver.

Thanks so much for any help. I'm using Mac OSX 10.9.5.

like image 514
nollaf126 Avatar asked Oct 30 '25 02:10

nollaf126


1 Answers

Use the -R (aka --reveal) option to select a single file:

open -R "/Volumes/Server/Resources/stock1/image.eps"

Something like,

open -R "/Volumes/Server/Resources/stock1/"*.eps

will not select all eps files in the folder, but instead will select each one successively, so that the end result is only the last file is selected.

like image 143
chepner Avatar answered Nov 01 '25 20:11

chepner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!