On a Linux desktop, we might want to add the Open in Terminal option in the context menu of Nautilus, the default file manager of GNOME. Specifically, this option enables us to open a terminal window directly at the current location of the file manager.
For example, we can add Open in Terminal to the Nautilus context menu to work in the terminal alongside the file management tasks. Moreover, with this option, we can execute commands in the current directory, without manually navigating to it in the terminal.
In this tutorial, we’ll check out methods for adding Open in Terminal to the context menu of Nautilus on a Ubuntu 22.04 installation.
Specifically, we use the nautilus-extension-gnome-terminal extension and the Preferences settings of the GNOME desktop.
2. Using the Preferences Settings
The Preferences settings of Nautilus enable us to modify several aspects of the file manager of a GNOME desktop. Moreover, we can use these settings to customize the actions available in the context menu of Nautilus.
In this case, we configure the Preferences settings of Nautilus to add the Open in Terminal option to its context menu.
To do so, we open Nautilus, go to the Edit menu, and click Preferences:
Then, we switch to the Context Menus tab from the left-side panel and enable the Open in Terminal option for both the Selection and Background sections:
After that, we click on the X icon to apply changes to the entries of the Nautilus context menu:
Now, we right-click anywhere in Nautilus to check the result:
Consequently, the changes reflect the Open in Terminal entry of the context menu of Nautilus on our system.
3. Using the nautilus-extension-gnome-terminal Extension
In a GNOME desktop environment, the nautilus-extension-gnome-terminal extension is used to extend the functionality of Nautilus. In particular, we can use it to add the Open in Terminal option to the context menu in Nautilus.
For this, first, we need to install the nautilus-extension-gnome-terminal package via apt:
$ sudo apt install nautilus-extension-gnome-terminal
After a successful installation, we run the nautilus command with the -q option to restart Nautilus:
$ nautilus -q
Lastly, we open Nautilus and right-click anywhere to open the context menu to view the applied changes:
Thus, we can now see Open in Terminal in the context menu of Nautilus on the system.
In this article, we learned different methods for adding the Open in Terminal option in the context menu of Nautilus in Linux.
Particularly, we can install the nautilus-extension-gnome-terminal package, if we prefer to add the Open in Terminal entry to the Nautilus context menu through an additional extension. On the other hand, the Preferences settings of Nautilus enable us to perform the same functionality with a few clicks.
Ultimately, we can select any of these methods based on our preference for using the built-in settings of Nautilus or an additional extension.