Productive— faster every day
For your professionTeachersStudentsManagersMarketingDevelopersFreelancersParents

Tips & tricks · Workflow · Everywhere · ~2 min a day · 3 min read

From the terminal to File Explorer or Finder: open . and explorer.exe .

Last reviewed:

Illustration for: From the terminal to File Explorer or Finder: open . and explorer.exe .

The terminal is great for commands, but sometimes you just need to see a folder: drag a file out of it into an email, glance at image thumbnails, throw something in the trash. Few people know that the path from the terminal to the graphical world is a single command: open . on a Mac, explorer.exe . on Windows, and xdg-open . on Linux all open the exact folder you're standing in inside the terminal. The dot means “the current directory” — no manually hunting down the same folder in the Explorer tree.

How to do it

  1. On a Mac, type open . in the terminal — the folder opens in Finder. The open command also works on a specific file: open report.pdf opens it in its default app, as if you'd double-clicked it.
  2. On Windows (PowerShell or cmd), use explorer.exe . — File Explorer opens in the current folder. The shorter explorer . works too; open a file with start filename.xlsx.
  3. In WSL, the Linux environment inside Windows, explorer.exe . works too — and it's the most convenient bridge between the Linux filesystem and Windows: the folder opens in File Explorer even when it lives inside WSL.
  4. On Linux with a desktop environment, xdg-open . does the job — it opens the default file manager; the same command also opens files and web addresses.
  5. It works the other way too: from File Explorer to the terminal, by typing “cmd” into the address bar. Both directions together mean you never have to search for the same folder twice.

A typical scenario

A developer just generated a report in the terminal into the folder build/reports/2026-08 and needs to send the file to a colleague in chat. Without the trick, he'd open File Explorer and click his way through the folder tree to a long path he already has printed in front of him. This way he just types explorer.exe ., the folder pops up, and he drags the file into the chat with the mouse. The whole thing takes three seconds — and works the same way for a project nested ten levels deep.

On a Mac the trick goes even further: open -a "Visual Studio Code" . opens the current folder in a specific app, and open -R file.txt reveals a file in Finder with it selected — ideal when you want to drag one specific file out of deep inside a project. On Windows, explorer.exe /select,file.txt serves the same purpose.

What you get out of it

A small everyday frustration disappears: “I'm already here in the terminal, so why am I searching for this folder again in File Explorer?” Switching between the command line and the graphical file manager becomes instant, in both directions. And the open, start, and xdg-open commands are handy for files too — they open anything in its default app without ever leaving the terminal: a PDF in your browser, a spreadsheet in Excel, an image in your photo viewer.