← Back to context

Comment by alsetmusic

2 years ago

Also, `cd .` to open the current directory in a Finder window.

Not mine (found online years ago), but here's the opposite. `cd` into the frontmost Finder window:

  cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')";

You can also just drag the proxy icon onto the terminal window for its path, ie “cd “ <drop>, enter.

  • I use that all the time. You can also cmd-c copy a file in Finder then paste into the terminal to get its path.

    • I genuinely didn't know this. I would have thought I had to do the "copy as pathname" trick with a right-click while holding Option. I already knew the drag and drop feature, so this doesn't really save me time, but it's good to know another nice feature.