Git Bash bash: open: command not found

Viewed 75463

I'm new to Git Bash, just freshly downloaded this for use in my class today, on the first class module it ask me to cd in to different directory and ls the content which works perfectly fine in Git Bash, then it ask me to open a README.md file in a folder with the command:

open README.md

then this error message show up:

bash: open: command not found

I know I cd in to the correct folder, and ls does shows the the README.md file, this is a freshly installed and most updated Git Bash, can't imagine there would be a missing link or altered in this program... what can I do? please help thank you!

I'm using Windows 8 with Git for windows

6 Answers

I had the same problem at first when I started using Git Bash in my Windows computer. I wanted to open a folder on my Desktop. I specified the current directory, which was cd Desktop/test and then I gave the command open . to open the 'test' file, and I received bash: open: command not found. I searched through the internet to find a way to open the file, and then finally I tried this one and it worked.

Solution :

  1. Specify the root directory of the file -> cd Desktop
  2. use "start" keyword and give the file name that you want to open -> start test

open is a linux specific command for Git Bash

You can access your file using the start command like start filename.extension this will open your file using Notepad if you are using Windows 10.

To access file with some text editor you can simply write the command as start texteditorname filename.extension.

To access file with VS Code just simply type start code filename.extension.

To access file with ATOM just simply type start atom filename.extension.

As described in the first Answer, I used "start" to open my Text File and it works.

I am using Ubuntu and instead of using open or start, use explorer.exe if you're trying to open in the browser.

explorer.exe filename

for example:

explorer.exe index.html

You could also just try it without "start". In my case, "subl ." and "code ." both work to open the cwd in the respective editors. I assume it is just an alias for "subl start"/"code start".

Related