19 Oct 2024

How to Open File Manager from Terminal in Linux?

Opening the file manager from the terminal in Linux is a simple and efficient way to navigate your system without leaving the command line. No matter which desktop environment you are using, Linux offers a universal command that works with the default file manager, allowing you to easily access your files from the terminal. In this blog, we’ll explore how to open the file manager and even how to open specific files directly from the terminal.

Opening File Manager

If you need to open the file manager in the current directory from the terminal, you can use the xdg-open command. This command works across most desktop environments and opens the file manager with your current directory displayed.

xdg-open .

The . refers to the current directory, and the xdg-open command tells the system to open it using the default file manager.

You can also use browse command it's just symlink of xdg-open

browse .

Solution 3: Gnome Desktop Environment

If you are using the Gnome desktop environment, you can use the gnome-open command to open the current directory in the file manager. This command is specific to Gnome environments.

gnome-open .

Solution 4: Nautilus File Manager

If you are using Nautilus, the default file manager for Gnome, you can use the nautilus command followed by the directory path. To open the current directory, use:

nautilus .

Opening Files from the Terminal

In addition to opening directories, you can also use the terminal to open files as if you had double-clicked them in the file manager. The xdg-open command can be used with any file to open it with the default application associated with its file type. This can be extremely useful for quickly accessing documents, images, or other files directly from the terminal.

xdg-open filename

Simply replace filename with the name of the file you want to open, and it will launch the file in the appropriate application.

Useful Tips

Conclusion

With the xdg-open, gnome-open, and nautilus commands, you can quickly and easily open the file manager or launch files from the terminal in Linux. These methods work across most desktop environments and help improve efficiency when navigating through your system. Whether you’re managing files or accessing specific documents, the terminal offers a fast and flexible solution.

You may also like

Can't connect to a wired connection in Linux

Troubleshoot wired connection issues in Linux: check cables, network...

Continue reading

Extracting Data with Beautiful Soup from HTML and XML

Beautiful Soup is a Python library that can be used for extracting d...

Continue reading

5 Reasons Why Linux is the Best Operating System for Programming

Linux is a reliable, customizable operating system that is popular a...

Continue reading