“找不到引用控制台的文件描述符"在Windows上的Ubuntu bash上 [英] "Couldn't find a file descriptor referring to the console" on Ubuntu bash on Windows

查看:118
本文介绍了“找不到引用控制台的文件描述符"在Windows上的Ubuntu bash上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的人,这是我的第一篇文章.

我在Windows的Ubuntu上的Bash遇到问题.如果我在Mac终端上键入"open(文件名)",它将使用正确的程序打开文件,但是如果我尝试在Windows bash上使用它,则会显示:找不到引用控制台的文件描述符". /p>

我也尝试过xdg-open和gnome-open,但是它们都不起作用.有人可以解释如何解决该问题以及open命令的工作原理吗?
预先感谢!

解决方案

您可以使用xdg-open代替打开,而与应用程序(例如pdf,图像等)无关,它可以执行相同的操作.它将打开一个新的虚拟终端(我已经在Linux上尝试过这个

示例:

xdg-open ~/Pictures/Wallpapers/myPic.jpg

xdg-open ~/Docs/holidays.pdf

I'm new in here and it's my first post.

I have a problem with Bash on Ubuntu on Windows. If I type "open (filename)" on Mac terminal, it opens the file with the right program but if I try to use it on Windows bash, it says: "Couldn't find a file descriptor referring to the console".

I have also tried xdg-open and gnome-open but none of them works. Can someone explain how to fix the issue and how open command works?
Thanks in advance!

解决方案

Instead of open u can use xdg-open which does the same thing, independently of application i.e. pdf, image, etc. It will open a new virtual terminal (I have tried this on Linux)

Example:

xdg-open ~/Pictures/Wallpapers/myPic.jpg

xdg-open ~/Docs/holidays.pdf

这篇关于“找不到引用控制台的文件描述符"在Windows上的Ubuntu bash上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆