如何从linux控制台运行文件关联应用程序

如何从linux控制台运行文件关联应用程序,linux,ubuntu,console,Linux,Ubuntu,Console,在windows上执行exist命令: start myfile.mp3 start myfile.txt 在mac上: open myfile.mp3 open myfile.txt Ubuntu下有模拟命令吗?Linux中有几个命令可以帮助您打开与应用程序相关的文件。如果您知道要打开文件的应用程序,那么这可能会起作用。我不确定你是否在找这个 env DISPLAY=:0.0 firefox“google.com” 打开Firefox并在其中打开google.com。您可以替换应用程序名和

在windows上执行exist命令:

start myfile.mp3
start myfile.txt
在mac上:

open myfile.mp3
open myfile.txt

Ubuntu下有模拟命令吗?

Linux中有几个命令可以帮助您打开与应用程序相关的文件。如果您知道要打开文件的应用程序,那么这可能会起作用。我不确定你是否在找这个

env DISPLAY=:0.0 firefox“google.com”
打开Firefox并在其中打开google.com。您可以替换应用程序名和文件名并使用此命令

xdg open
如果您有一个与freedesktop.org兼容的环境。

对于支持gnome的发行版,请尝试“gnome open”

gnome open random-file.torrent将打开我的torrent应用程序