2

I am looking for a command that, when called in terminal, will cd to the directory that is open in the most current nautilus widows.

On Mac, I use cdf provided with zprezto/oh-my-zsh that wraps OSX commands. It makes moving between Finder and terminal so easy and natural.

  • Are you looking for this? – terdon May 5 '15 at 9:57
  • No, I do not want to right click, I want to write cdn in my terminal to open a directory that is opened in nautilus. – Skarab May 5 '15 at 10:09
  • Yes, but I doubt that is possible. You would have to export the directory nautilus is looking at as an environmental variable. Finder is much more integrated into OSX than nautilus is in Unity so I'm not sure that would be possible without hacking nautilus's code. Won't this do as a workaround? – terdon May 5 '15 at 10:18
  • The only problem I see is finding last window. Script can open context menu and call a custom action from it, I think. – Velkan May 5 '15 at 10:23
  • If I understood correctly you want to use cdf command to switch current directory in terminal to the one used in last nautilus window? It is to be used as a single command and not in syntax? – VRR Aug 1 '15 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.