How to open a file manager of the current directory in the terminal?

320,854

Solution 1

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

Solution 2

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 .

Solution 3

You write nautilus [path]. for current directory -

nautilus .

Solution 4

In Ubuntu 20.04, you can just say browse . to open the current directory

Solution 5

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

gnome-open .
Share:
320,854

Related videos on Youtube

dv3500ea
Author by

dv3500ea

I am an Ubuntu user (since Jaunty) and also a programmer (by hobby - no formal education). I found the community on Ubuntu Forums extremely helpful and so started to return the favour and never stopped :) I am currently involved with the development of the following FOSS projects: DMedia - a distributed media library, to be used by the Novacut video editor. (IRC: #novacut) QR Tools - tools for creating and reading QR codes. Both of these projects actively welcome new contributors so feel free to help out. If you are interested but don't know where to start feel free to contact me. If you find my answers helpful, and you have money to waste spare, you may donate to me via: flattr Bitcoin - 14wAQSJT4F1QsUUdUVvZS5TXmgvCyNr1ET youtipit

Updated on September 17, 2022

Comments

  • dv3500ea
    dv3500ea over 1 year

    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?

    • dv3500ea
      dv3500ea about 13 years
      I don't think this question is an exact duplicate. There are many similar questions with some identical answers but none of the questions have the exact same focus as this question. The closest question is How to open a directory/folder and a URL through Terminal
    • CypherX
      CypherX over 2 years
      Tried all the answers below. The ones that worked on Ubuntu 20.04 are: xdg-open ., nautilus ., browse .. But gnome-open . did not work as-is (I guess either gnome is not installed or there's some other reason for that). Nonethless, this is to confirm what worked as of 01-Feb-2022.
  • vidur punj
    vidur punj almost 8 years
    To use it first install: sudo apt install libgnome2-bin
  • WesternGun
    WesternGun over 7 years
    This is the most complete one and should be the answer. Works in RedHat 7.2 x64.
  • The Godfather
    The Godfather almost 7 years
    Doesn't work for Ubuntu 16
  • The Godfather
    The Godfather almost 7 years
    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
  • Tim
    Tim about 6 years
    Is there a way to open gnome as sudo? I tried sudo gnome-open . with no luck.
  • рüффп
    рüффп over 5 years
    Works in CentOS 6.10 as well.
  • gdaras
    gdaras over 5 years
    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.
  • Vladislav Rastrusny
    Vladislav Rastrusny about 5 years
    This is easily solved by adding & to the end like this: nautilus . &
  • Nino Filiu
    Nino Filiu about 5 years
    @TheGodfather it works it Ubuntu 18.04
  • danilo
    danilo almost 5 years
    for ubuntu, uses: caja, or nautilus
  • cbloss793
    cbloss793 almost 5 years
    Works like a charm in Ubuntu 18. :) Thanks for this!
  • Drazen Cika
    Drazen Cika over 4 years
    Works for me in Ubuntu 16.04
  • Jules Colle
    Jules Colle over 4 years
    This is easier to remember for me.
  • vulpxn
    vulpxn almost 4 years
    This shows a deprecation warning, the newer command is gio open . (Centos 7)
  • Asocia
    Asocia about 3 years
    browse is just a symlink to xdg-open. So you can use both of them in the same way. (i.e you can also open files with browse)
  • zean_7
    zean_7 almost 3 years
    Is there a similar command to "Choose a file"? e.g. It will open the default file manager and you can choose/select a file and it'll return the file's absolute path? More like a "File-picker"?