Is it possible to open a terminal in the current directory?

I am new to Ubuntu, and was wondering whether it is posible to open a terminal with a path matching your current location in the file manager? In Windows it was very easy, but how do you do it in Linux?


From https://askubuntu.com/a/207448/371765

Run sudo apt-get install nautilus-open-terminal in a terminal, followed by nautilus -q to quit all open nautilus windows. When nautilus is next opened, a line saying open in terminal should appear in the right click menu.

Please note that the package nautilus-open-terminal is in the universe repositories.


With Dolphin Install dolphin, KDE's file manager, you have two options:

  1. Open a terminal as a panel in the same window. Use the keyboard shortcut F4 or the menu: ControlPanelsTerminal.

    The working directory is synchronized between the two panels; changing directories in either of the two panels will also change it in the other. Sweet!

    enter image description here

    In this screenshot you even see the sweetness of having this as a toolbar item in the top.

  2. Open a terminal in a new window. Use Shift+F4 to do that. It will not have the feature to have the working directory synchronized, but it just opens a new window with the current working directory set.

The same applies to other apps in KDE Plasma, like the Kate text editor (enable it in Kate's settings, it's a built-in plug-in). Opening a terminal with a single keyboard shortcut from your text editor with the context of the file, is simply brilliant.


Update , April 11

Create a simple script opendirectory.sh with the following contents

#!/bin/sh
# set -x
OPENDIR=$(zenity --entry --text="Type or paste address");gnome-terminal --working-directory="$OPENDIR" &

Bind that script to a shortcut , for instance Ctrl+Alt +i, or whatever you like.

Now, when you are in some directory in nautilus, press Ctrl+L to open address bar. Copy the address of your current directory with Ctrl+X.

Lauch the shortcut you just created and paste the address with Ctrl+V in to the dialog. Terminal should pop-up with the directory that you told the dialog to open.

IMHO, this is as "native" as it gets and doesn't require additional installation. Sure, it is not a right click type of thing, but it works and can be implemented quickly. Will work for other file managers that don't support this option,too

Original Post

Technically nautilus, the default file manager, doesnt have open terminal here option, but there is a plug in for that in the repositories. You might be more interested in other file managers that support this option out of the box

As a workaround you could try the following:

Ctrl+L willopen the text filed for entering address, with the current working directory highlighted. Cut that out with CtrlX, and paste into terminal with CtrlShiftV or right click. Alternative , use run dialog to launch gnome-terminal --working-directory= and paste whatever you copied after = sign.

Drag and drop: Drag the button/tab (not sure how it's called) into terminal, add cd in front

enter image description here

Another way: Open the file manager and terminal. Drag and drop the folder you want to access into terminal, and add cd to the path.

For instance, if I want to access bin directory in my /home/serg/ directory, i would drag that directory to terminal and it would appear as '/home/serg/bin'. Next, add cd, so that the whole line is cd '/home/serg/bin' .