Git Bash 打开命令窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32793782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git Bash Open Command Windows
提问by Branden Kennedy
I'm extremely new to the command line and just programming in general. I use windows, and I'm doing prep work for viking code school. In one of the lessons it asks us to use the 'open' command in Git Bash (we were to download Git Bash if we weren't on Linux or Mac) which will not work for me. When I type it, I get the error "bash: open: command not found", how can I fix this or work around it? Thank you
我对命令行非常陌生,一般只是编程。我使用 Windows,我正在为维京代码学校做准备工作。在其中一课中,它要求我们在 Git Bash 中使用“打开”命令(如果我们不在 Linux 或 Mac 上,我们将下载 Git Bash),这对我不起作用。当我输入它时,我收到错误“bash: open: command not found”,我该如何解决或解决它?谢谢
回答by lalthomas
No you can't use open
on windows. I think the closest to open
in windows will be explorer
, which will open the file using default associated windows programs.
不,您不能open
在 Windows 上使用。我认为最接近open
in windows 的是explorer
,它将使用默认关联的 windows 程序打开文件。
回答by VonC
open
isn't a shell command or a program name, it is a system call.
open
不是 shell 命令或程序名称,它是一个系统调用。
On Unix, Unix-like and other POSIX-compliant operating systems, popular system calls are
open
,read
,write
,close
,wait
,exec
,fork
,exit
, andkill
.
在Unix,类Unix和其他POSIX兼容的操作系统,流行的系统调用
open
,read
,write
,close
,wait
,exec
,fork
,exit
,和kill
。
Git for Windowsis based on mingw64, and open()
is not a system call on Windows. Simply calls an editor or a bash command to open the file.
适用于 Windows 的 Git基于mingw64,而open()
不是 Windows 上的系统调用。只需调用编辑器或 bash 命令即可打开文件。
cat file.txt
more file.txt
/path/to/editor.exe file.txt # like sublimeText.exe
Julixadds an example illustrating a Windows path:
Julix添加了一个说明 Windows 路径的示例:
/c/WINDOWS/system32/notepad.exe file.txt(<- change that to your file)
回答by Jessica B
I'm also a complete beginner, but it seems that the command you want is start
(at least when applied to a program or program-file-pair).
我也是一个完整的初学者,但似乎您想要的命令是start
(至少在应用于程序或程序文件对时)。
回答by Yvonne.D
I found two kinds of command lines would work same as open in Mac.
我发现两种命令行的工作方式与在 Mac 中打开的方式相同。
start filename
explorer filename
回答by Bunny
"open" cannot be used on windows. The closest to open in windows will be the 'explorer"(to open the default explorer) or "explorer ."(to open the current directly).
“打开”不能在 Windows 上使用。在 Windows 中最接近打开的是“资源管理器”(打开默认资源管理器)或“资源管理器”(直接打开当前浏览器)。
回答by Pavlin
For Git Bash on Windows, type the .exe name of your editor, for example, Visual Studio Code exe is Code.exe
followed by space and dot. So you write Code .
, and it will open all files with your editor.
对于 Windows 上的 Git Bash,键入编辑器的 .exe 名称,例如,Visual Studio Code exeCode.exe
后跟空格和点。所以你写Code .
,它会用你的编辑器打开所有文件。
回答by Sumeet Masih
look commands are little different in unix terminal and windows command prompt.. solution would be 1) Download git from https://git-scm.com/downloadsthis will convert your linux command to windows command 2) What is the command ..?? post it as well .. may be we can help
看看命令是在UNIX终端略有不同和Windows命令提示符..解决办法是:1)下载的git从https://git-scm.com/downloads这将您的Linux命令窗口命令2)什么是命令.. ?? 也贴出来..也许我们可以帮忙