Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open the current directory on Bash on Windows?

I know that in the Mac OS10, people use the open . command to open the current directory.

Does anybody please know the appropriate command to do the same task under Bash on Windows?

Cheers!

like image 852
Yass001 Avatar asked Nov 30 '16 03:11

Yass001


People also ask

How do I get the current directory in bash?

By default, bash shows just your current directory, not the entire path. To determine the exact location of your current directory within the file system, go to a shell prompt and type the command pwd.

How do I open the current directory in terminal Windows?

Simply type in wt in the address bar and it will open the command prompt with the path to your current folder already set.

How do I open a git bash folder in Windows?

Using Windows Explorer, navigate to any directory you want, type "cmd" in the address bar it will open Windows command prompt in that directory. Along the same lines, if you have the git directory in your path, you can type "git-bash" in the address bar and a Git Shell will open in that directory.

How do I open a bash file in Windows?

Press Windows key + X then click Command prompt, at the command prompt, type: bash then hit Enter. If you want to be able to access the local file system, press Windows key + X, Command Prompt (Admin) then type bash at the prompt.


2 Answers

Just Type

start . 

it will open the current the directory folder.

like image 76
Jakegarbo Avatar answered Sep 21 '22 23:09

Jakegarbo


You can now call explorer.exe from the bash subsystem. I've set up an alias to use it. I've added the copy to clipboard alias as well for good measure.

Alias:

alias open="explorer.exe" alias pbcopy="clip.exe" 

Example:

cat ~/.ssh/id_rsa.pub | pbcopy open . open "D:\\Dir" 

The open alias plays well with ., but you'll need to pass it the Windows path if you want to specify a directory.

like image 43
Pieter-Uys Fourie Avatar answered Sep 21 '22 23:09

Pieter-Uys Fourie