How To Access the Current Directory’s File Manager from the Terminal in Linux/Ubuntu
Sometimes, navigating around in the terminal feels fast, but you still want quick access to your folders graphically. Maybe you’re deep in some commands and just want to peek at your files with a click, or perhaps you’re copying stuff around and prefer doing it visually. Whatever the reason, knowing how to fire up the file manager right from the terminal can save a few steps—and yes, it’s kinda weird how useful this is once you get used to it.
This guide walks through the simple command that opens your current directory’s window in Ubuntu’s default file manager. It’s pretty straightforward, but there’s a few gotchas, like ensuring the right command is installed or knowing where to look if things don’t open immediately. Master this, and it becomes second nature—kind of like a little shortcut for your workflow. Expect quick, clean access, and maybe even some “why didn’t I do this sooner” moments.
How to Open the File Manager from the Terminal in Ubuntu
Find Your Current Location in the Terminal
Before launching the file manager, it helps to know where you are in the filesystem. The *pwd* command is your friend here. It shows the full path of your current directory, like /home/user/Documents
. Open your terminal (yeah, Ctrl + Alt + T still works), then type:
pwd
This command outputs where you’re working from. When you hit Enter, you’ll see the path—makes sense, right? Because of course, Linux loves giving us a way to see where we are before doing anything big.
Launch the File Manager with a Single Command
Once you’ve got your position, it’s time to open the folder view. Use this command:
xdg-open .
Yes, the dot at the end is important. It represents “here”—the current directory. That way, the command tells Ubuntu to open whatever folder you’re in right now. When you press Enter, the default file manager (usually Nautilus in Ubuntu) pops open showing your files and folders. Cool, right? On some setups, it might take a second or so, especially if the system is busy, but generally, it’s instant.
Note: If this doesn’t work at first, check if xdg-open is available. It’s supposed to come with Ubuntu by default, but sometimes it’s missing or broken. In that case, you can try reinstalling it with:
sudo apt install xdg-utils
which will make sure you have the necessary bits. Also, on some setups, the default file manager might be different, but xdg-open
usually handles that smoothly.
Extra Tips & Troubleshooting
- If the folder doesn’t open, double-check that you’re in the right directory by running
pwd
again. Sometimes, just changing to the folder you want withcd
and running the command there is easier. - For a quicker way, you can also create an alias in your shell profile (like in
~/.bashrc
) such asalias open='xdg-open .'
. Then just typingopen
will do the trick anytime. - And yes, this works from anywhere! Whether you’re in your home directory, a deep subfolder, or even on a mounted drive. Just make sure you’re in the right place or specify the path like
xdg-open /path/to/folder
.
Wrap-up
Changing between terminal and GUI in Ubuntu doesn’t have to be a pain. This little command — xdg-open .
— is simple but super effective. It makes your workflow more flexible and saves clicking around in the GUI menus. Not sure why it works, but it’s reliably saved me a lot of time when I needed a quick peek at my folders while working in the terminal.
Summary
- Open terminal with Ctrl + Alt + T or find it in your applications menu.
- Use
pwd
to see where you are. - Type
xdg-open .
to open the current folder in your default file manager. - If it doesn’t work, check your xdg-utils installation or try specifying a full path.
Conclusion
It’s kinda funny how such a tiny command makes life easier—on one machine it opened perfectly the first time, on others maybe a minute of poking around, updating packages or rebooting was needed. But once it’s working, it’s just there, ready whenever you need a quick visual. Hopefully, this saves someone a few clicks or frustration, because Windows/MS Windows-style workflows don’t have to be the only way.