Have you ever been in the middle of using your command line terminal, and suddenly needed to open the file explorer? In some cases, it can be easier or more convenient to visualize the contents of a directory from a graphical file explorer, rather than using the ls command or others to sift through the files. Fortunately, Linux gives us an easy way to open a file explorer and have it navigate directly to the directory we are currently viewing in the terminal.
In this tutorial, we will show you how to open the file explorer from a command line terminal on a Linux system. The process for doing this will vary slightly, depending on what desktop environment you are using, so we will cover the most popular ones below.
In this tutorial you will learn:
- How to open file explorer from terminal in GNOME, KDE, XFCE, MATE, LXQT, or Cinnamon
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux distro|
|Software||GNOME, KDE, XFCE, MATE, LXQT, Cinnamon|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to open file explorer from terminal on Linux
The basic process for opening the file explorer from your terminal is to execute the command that relates to your file explorer application. The caveat here is that each desktop environment tends to name their file explorer differently, so it is never the same command. We will cover the default file explorers for some of the most popular Linux desktop environments below.
In the commands below, we append a
.which tells the file explorer to open the current directory in which your terminal resides. This is not strictly necessary, and you can provide a different path if you wish.
GNOME is the default desktop environment for Ubuntu Linux and names their file explorer Nautilus. To open the file explorer in GNOME, enter:
$ nautilus .
KDE uses the Dolphin file manager. To open the file explorer in KDE Plasma, enter:
$ dolphin .
Xfce uses the Thunar file manager. To open the file explorer in Xfce, enter:
$ thunar .
MATE utilizes the Caja file manager. To open the file explorer in MATE, enter:
$ caja .
LXQt has the pcmanfm file manager. To open the file explorer in LXQt, enter:
$ pcmanfm-qt .
Cinnamon is the default desktop environment for Linux Mint and uses the Nemo file manager. To open the file explorer in Nemo, enter:
$ nemo .
In this tutorial, we saw how to open the file explorer from a command line terminal on a Linux system. Using these methods for your corresponding desktop environment or installed file manager will help you to quickly access the file explorer and have it navigate instantly to the directory that you are already working with.