In short. There are two routes to handling files on Windows: open Explorer, or open a terminal. Which one is better has no answer. The time actually leaks somewhere else — when a single job makes you cross between the two. I settled it by removing the cost of crossing, and here are the three bridges I use.
They are good at different things
There are situations where Explorer is clearly faster. Skimming a folder you are opening for the first time. Hunting for a file whose name you cannot remember. Clicking a photo or a PDF to check it. For jobs that end with looking and pointing, there is no reason to build a command.
The situations where the terminal wins have a different character. Doing the same job a second time. Applying a condition, such as only this extension or only files changed since yesterday. Needing a record of what you did.
So the test comes down to one question. Will I do this again? For a one-off, Explorer is faster. For something you will repeat, it is better to give it a name in the terminal and keep it. Work done in Explorer leaves no trace. Doing the same thing next month means clicking your way through it again.
The trouble comes when one job straddles both sides. Picking yesterday's files out of twenty logs and attaching them to an email is like that. Picking is overwhelmingly faster in the terminal. Getting them into the mail window needs the clipboard or the mouse. At that point people reopen Explorer and start looking for the files by eye. The three things below remove that round trip.
Crossing from the terminal to Explorer
The first is opening the folder you are in as an Explorer window. One line does it.
alias exp='start "" "$(pwd)"'
No more digging back down to a folder in Explorer that you already reached with cd.
The second is picking files in the terminal and putting the result on the clipboard as files. It is the files themselves rather than text. Ctrl+V in Explorer or a mail composer pastes them directly.
fcp() {
local w=()
for f in "$@"; do [ -e "$f" ] && w+=("'$(cygpath -aw "$f")'"); done
[ ${#w[@]} -eq 0 ] && { echo "fcp: no files" >&2; return 1; }
local list; list=$(IFS=,; echo "${w[*]}")
powershell -NoProfile -Command "Set-Clipboard -Path @($list)"
}
The key part is cygpath -aw, which converts a Git Bash path into a Windows path. PowerShell does not understand /tmp/a.txt. Check what actually ended up on the clipboard and you see this.
$ fcp a.txt b.txt
$ # what went on the clipboard
C:\Users\dualk\AppData\Local\Temp\src\a.txt
C:\Users\dualk\AppData\Local\Temp\src\b.txt
Now the earlier example is one line. fcp $(ls -t *.log | head -5) puts the five most recent logs on the clipboard. You paste them in the mail window.
Crossing from Explorer to the terminal
The other direction has two parts: bringing a folder over, and bringing files over.
For folders the context menu is shortest. Right-click a folder in Explorer and entries such as Open WezTerm here appear. They open a terminal in that folder. The Git Bash one is registered automatically when you install Git. These are the commands in my registry.
Directory\shell\git_shell
"C:\Program Files\Git\git-bash.exe" "--cd=%1"
Directory\shell\Open WezTerm here
"C:\Program Files\WezTerm\wezterm-gui.exe" start --cwd "%V\"
There is one thing worth knowing here. Right-clicking a folder and right-clicking empty space inside a folder read different places. The first is Directory\shell, the second Directory\Background\shell. A program registered in only one of them appears in the menu sometimes and not others. On Windows 11 the context menu is shortened. Use "Show more options" or Shift+F10 to see the full menu.
Bringing files over is fpaste. Press Ctrl+C in Explorer, call it in the terminal, and the files are copied into the current folder.
fpaste() {
powershell -NoProfile -Command "Add-Type -A System.Windows.Forms; [Windows.Forms.Clipboard]::GetFileDropList() | ForEach-Object { \$_ }" |
tr -d "\r" | while IFS= read -r f; do
[ -n "$f" ] && cp -r "$(cygpath -u "$f")" "${1:-.}" && echo "pasted: $(basename "$f")"
done
}
GetFileDropList pulls the file list out of the clipboard. cygpath -u turns the Windows paths back into Git Bash paths. File names with spaces come across intact.
$ fpaste
pasted: a b.txt
pasted: c.txt
Give fcp and fpaste a short alias each and your hands remember those first. I use ccp and ccv, named straight after Ctrl+C and Ctrl+V.
Summary
| Direction | Command | What it does |
|---|---|---|
| Terminal → Explorer | exp | Opens the current folder in an Explorer window |
| Terminal → anywhere | fcp file… | Puts the chosen files on the clipboard |
| Explorer → terminal | Right-click a folder | Open WezTerm here opens a terminal in that folder |
| Explorer → terminal | fpaste | Brings files you copied with Ctrl+C into the current folder |
Explorer and the terminal are not competitors. One-off work is faster in Explorer. Work you will repeat is better named and kept in the terminal. What is left is the cost of crossing between them, and the three lines above nearly remove it.
If you add only one of the three, make it exp. It is one line, and from the day you add it you stop navigating back to folders in Explorer.
