106

When I work in terminal, sometimes I want to open the current directory in a GUI file manager. And then to click the items in the window to run the application. How can I do this?

145

The following works in all desktop environments by using the default file manager:

xdg-open .

You can also open files from the terminal as if you had double clicked them in the file manager:

xdg-open file
  • 1
    Doesn't work for Ubuntu 16 – The Godfather Jun 14 '17 at 7:45
  • Works in CentOS 6.10 as well. – рüффп Oct 19 '18 at 6:25
  • @TheGodfather it works it Ubuntu 18.04 – Nino Filiu Apr 29 at 21:23
  • for ubuntu, uses: caja, or nautilus – danilo May 25 at 17:44
  • Works like a charm in Ubuntu 18. :) Thanks for this! – cbloss793 Jun 4 at 18:14
26

You write nautilus [path]. for current directory -

nautilus .
  • This has the disadvantage that you have to keep terminal window alive while you are navigating. If you kill the window, the file explorer gets killed too. – gdaras Oct 23 '18 at 15:22
  • 2
    This is easily solved by adding & to the end like this: nautilus . & – Vladislav Rastrusny Mar 8 at 14:31
25

Problem

This tip will explain How to open a file manager of the current directory in the terminal

Solution 1

The following works in all desktop environments by using the default file manager:

xdg-open .

Solution 2

You can also open files from the terminal as if you had double clicked them in the file manager:

xdg-open file

Solution 3

If you are using Gnome, you can use the gnome-open command, like so:

gnome-open .

Solution 4

You can use nautilus [path]. for current directory -

nautilus .
  • This is the most complete one and should be the answer. Works in RedHat 7.2 x64. – WesternGun Nov 10 '16 at 20:35
5

If you are using GNOME, you can use the gnome-open command, like so:

gnome-open .
  • 1
    To use it first install: sudo apt install libgnome2-bin – vidur punj Aug 3 '16 at 11:37
  • I wonder why isn't there common command for opening whatever the GUI is. I have tried all commands from above answers and no one worked for me. This is the only working on Ubuntu – The Godfather Jun 14 '17 at 7:46
  • Is there a way to open gnome as sudo? I tried sudo gnome-open . with no luck. – Tim Mar 16 '18 at 20:58
0

You can use, nautilus . and press enter to open the current directory.

To open path specified location try the following.

E.g. If you want to open Music folder under this location:

/media/dulithdecozta/A08A64BB8A648F98/Music/

Then execute the following.

nautilus /media/dulithdecozta/A08A64BB8A648F98/Music/

protected by Community Jul 16 '17 at 15:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?