我发现 Mac OS X 中的“打开”命令在命令行中非常方便。来自“人开”:
The
open
command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via LaunchServices is used to open the specified files.
也就是说,如果我想用默认的PDF查看器(恰好是预览)打开一个PDF文件,我只需要这样做:
open my.pdf
然而,在 Linux 中,要从命令行打开 PDF 文件,我不得不四处寻找默认的 PDF 查看器,例如“evince”(谁会猜到??),然后
evince my.pdf
那么,在 Linux 命令行中是否有一个简单的“open”命令?
谢谢!
最佳答案
您可以尝试 xdg-open
,大多数 Linux 发行版都有它。它将为您的文件打开默认关联的应用程序。
关于Linux 等效于 Mac OS X "open"命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/264395/