Git Bash Open Windows Command

I am extremely new to the command line and just programming in general. I use windows, and I am preparing a job for the Viking code school. In one of the lessons, he asks us to use the "open" command in Git Bash (we had to download Git Bash if we were not on Linux or Mac), which will not work for me. When I print it, I get the error "bash: open: command not found", how can I fix it or get around it? thank you

+7
source share
7 answers

No, you cannot use openin windows. I think that the closest thing to openin windows will be explorerthat will open the file using the appropriate default window programs.

+11
source

open- This is not a shell command or program name, it is a system call .

On Unix, Unix-like and POSIX-compliant other operating systems, system calls are popular open, read, write, close, wait, exec, fork, exit, and kill.

Git for Windows is based on mingw64 , and is open()not a system call on Windows. It simply calls the editor or bash command to open the file.

cat file.txt
more file.txt
/path/to/editor.exe file.txt # like sublimeText.exe

, Windows:

/c/WINDOWS/system32/notepad.exe file.txt(<- change that to your file)
+9

, , , start ( , ).

+6

, , Mac.

start filename
explorer filename
+1

unix Windows. 1) git https://git-scm.com/downloads, linux windows 2) ..?? .. ,

0

For Git Bash on Windows, enter the name .exe of your editor, for example, Visual Studio Code exe - this is Code.exethen a space and a period. So you write Code.and it will open all the files with your editor.

0
source

"Open" cannot be used on windows. The closest to opening in the windows will be "explorer" (to open explorer by default) or "explorer" (to directly open the current one).

0
source

Source: https://habr.com/ru/post/1609065/


All Articles