

If a URL is provided the URL will be opened in the users preferred web browser. From man xdg-open: xdg-open opens a file or URL in the users preferred application.
#OPEN A MAC FINDER WINDOW FROM TERMINAL HOW TO#
This can simple be done with a single command already as it turns out. If the question is how to open a file/folder, the answer is always xdg-open.
#OPEN A MAC FINDER WINDOW FROM TERMINAL MAC OSX#
If you have any little gems that might be useful to the Mac OSX world, it would be great if you could post them in the comments.

Not that I think that things are difficult in this excellent OS, but there is always room for shortcuts to speed up common tasks. I'm always on the look out for bits and pieces like this to help make my life easier in Mac OSX. bash_profile file: export PATH='$PATH:/Users/PhilH/Utils' This file gets invoked whenever you enter the Terminal environment.Īdd an item to your path by entering a line something like this to your. If you need help adding something to your path, I recommend creating a file in your home directory (it may even already exist) called. Now you can simply type fndr in your Terminal window to open a Finder at your present directory. I collect any little utility scripts like this together in a directory called Utils which I added to my path to make all of its contents easily accessible. Second, you should place this somewhere that is visible on your path. You should name this file with whatever you want to use to call it later. So I just need to know how to open finder from the terminal. Open /System/Library/CoreServices/Finder.app $PWD A mac mini I'm working on won't boot, so I have to run the disc that came with it, which can re-install mac osx, but I need to get some files off it, and I can't find a way from the disc to open a finder menu to copy files from the hard drive to an external one. To set things up so that it is easy to use whenever you need it, you just need to follow these two steps:įirst, using your preferred text editor create a file which contains this command: !/bin/bash Since it is something that I have a regular need for, I thought that there might be other Mac users out there who might also find this useful from time to time. I stumbled upon a simple method for opening a Finder window at your current Terminal session location recently.
