Ubuntu open terminal in current folder with shortcut

30,259

Solution 1

RIGHT-CLICK ON MOUSE/MOUSEPAD + E

For almost all keyboards there is a right-click key, simultaneously clicking right-click + e, works but the real flow is "right-click" then "e".

Ensure that in the folder in which you intend to use terminal, no file is highlighted. Otherwise, right-clicking will pull up the options to modify the selected file

This seems to be the most effective solution without having to modify any environment variables on your computer.

Solution 2

Since version 3.15.4 Nautilus doesn't load the accel file anymore (Source).

Fortunatelly there's a better aproach in order to get what you want. Long explanation/useful resources can be found here and also here. In short:

  1. Create a script called Terminal (yes, without a extension) inside the folder ~/.local/share/nautilus/scripts with the following content:

    # !/bin/sh
    gnome-terminal
    
  2. Make it executable, then close any Nautilus instance:

    chmod +x Terminal
    nautilus -q
    
  3. Create (or edit) the ~/.config/nautilus/scripts-accels file adding these lines:

    F4 Terminal
    ; Commented lines must have a space after the semicolon
    ; Examples of other key combinations:
    ; <Control>F12 Terminal
    ; <Alt>F12 Terminal
    ; <Shift>F12 Terminal
    
  4. Test it! Open Nautilus, right click, and choose Scripts > Terminal. Or, use the keyboard shortcut that you've just configured :)

Solution 3

Edit: Misunderstood the question. To do what you need, please follow this link:

https://askubuntu.com/questions/68078/keyboard-shortcut-for-open-a-terminal-here

You'll need to do some steps of the procedure listed below though.


For ubuntu 16.04, you can run the following commands:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install nautilus-open-terminal
sudo apt-get install nautilus-actions

After this, run

nautilus -q

to quit nautilus.

You should now have the right-click open terminal here option.

Original Answer has been taken from:

https://askubuntu.com/questions/207442/how-to-add-open-terminal-here-to-nautilus-context-menu

Please refer this for more details.

P.S.: Nautilus is the default file manager for GNOME DE.

If you're not using that, please refer this:

https://askubuntu.com/questions/602234/is-it-possible-to-open-a-terminal-in-the-current-directory/608619

Share:
30,259
erdemgunenc
Author by

erdemgunenc

Updated on July 12, 2021

Comments

  • erdemgunenc
    erdemgunenc almost 3 years

    I'm using Ubuntu 16.04 and I want to open the terminal in a current folder with short cut (not by right clicking and open terminal here). For example, by hitting f4 or something different key and it will open terminal at where I am.(maybe at /home/user/someDirectory).I researched a lot and couldn't find it, is there any sample scripts or options to do that ?

    Thank you.

  • erdemgunenc
    erdemgunenc about 6 years
    Thank you but its incorrect answer , if you read carrefuly i dont want to do it by right clicking. I am able to right clicking. I want to make it by short cut like hitting F4 or ctrl + alt + something.
  • Yuvraj Jaiswal
    Yuvraj Jaiswal about 6 years
    Edited. Please see if that solves your problem.
  • Spl0it92
    Spl0it92 over 5 years
    "Shift + F10" and then + "E" works fine!
  • Daniel
    Daniel about 4 years
    Another shorter version is in the presence of the menu-key on the tight side of the space bar and then E. MENUKEY+E
  • Tryer
    Tryer over 3 years
    This only works if a file within the folder is not highlighted. If it is highlighted, then this will act as if you pressed the right mouse button on the file.
  • Kvothe
    Kvothe over 3 years
    Perhaps I should ask as a separate question but what would make this work in nemo?
  • Eric
    Eric over 2 years
    In my case (mint mate), its shift + F10, then T.