And when you are in terminal and want to change dir to some different path, just drag and drop it from finder (either a file or just a icon from the title bar)
If you cmd-drop a file icon into Terminal, it will automatically cd into the parent directory, it prefixes the path with cd and appends ; at the end and executes it. If the icon is a folder, it will automatically cd into that directory.
If you shift-drop a file icon into Terminal, it will paste the file path to the command line without escaping spaces.
Is there a reverse version of that last one? For navigation I prefer Finder over `cd; ls`, but once I end up where I want to be I generally need a terminal.
edit: Another user replied with what I want as I typed this! Thank you haddr.
You’re referring to the tip to drag the Finder folder onto the Terminal window. There’s another way that is easier if you don’t already have a Terminal window open:
Install the app “cd to…” (https://github.com/jbtule/cdto) and add it to your Finder toolbar. Now clicking that icon will open a new Terminal (or iTerm) window within the selected folder.
cmd + shift + a = applications directory
cmd + shift + d = desktop directory
Semi-related, type `open .` in terminal to open that directory in Finder