Git Bash bash:打开:找不到命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35811533/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 22:12:37  来源:igfitidea点击:

Git Bash bash: open: command not found

gitbashgit-bash

提问by bogenwan

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 cdin to different directory and lsthe content which works perfectly fine in Git Bash, then it ask me to open a README.md file in a folder with the command:

我是 Git Bash 的新手,今天刚刚在我的课堂上刚下载了它,在第一堂课的模块上,它要求我cd到不同的目录,并且ls的内容在 Git Bash 中运行良好,然后它要求我使用以下命令打开文件夹中的 README.md 文件:

open README.md

打开 README.md

then this error message show up:

然后显示此错误消息:

bash: open: command not found

bash:打开:找不到命令

I know I cdin to the correct folder, and lsdoes 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!

我知道我cd到了正确的文件夹,并且ls确实显示了 README.md 文件,这是一个全新安装和最新更新的 Git Bash,无法想象在这个程序中会有一个丢失的链接或更改......我能做什么?请帮忙谢谢!

I'm using Windows 8 with Git for windows

我正在使用 Windows 8 和 Git for windows

回答by janos

bash: open: command not found

bash:打开:找不到命令

This error message is trying to tell you that there is no such command called "open". There's nothing wrong with the README.md.

此错误消息试图告诉您没有名为“open”的此类命令。没有什么问题README.md

  • OSX - openis a universal opener in OSX
  • Linux - has xdg-open
  • Windows - use start
  • OSX -open是OSX中的通用开启器
  • Linux - 有 xdg-open
  • 窗户 - 使用 start

But you don't need to take the instructions literally. It's not really important how you open the readme file. You can open it with the lesscommand to view the content inside the terminal, or you can open it with notepadfor editing in a text editor.

但是您不需要从字面上理解这些说明。如何打开自述文件并不重要。您可以使用less命令打开它以查看终端内部的内容,也可以打开它以notepad在文本编辑器中进行编辑。