EN
Windows - open file using Bash (via File Explorer)
3
points
This article, will show you how to open files via File Explorer using Bash on Windows.
Quick solution:
'C:/Windows/explorer.exe' /path/to/file
Reusable solution
In this section, you can find how create reusable alias and use it to open indicated files via File Explorer using Bash.
Simple steps:
- go to user home directory,
e.g. under Bash run the command:
e.g. in File Explorer use the path:cd ~%homedrive%%homepath% - add to
.bash_profilefile the following line:alias explorer='C:/Windows/explorer.exe' - re-run Bash or run in existing Bash
source ~/.bash_profilecommand,
- from now, you can open any file using
explorercommand, e.g.:explorer /path/to/file
Practical example: