sch*_*obe 6 command-line shell files file-opening
假设我有一个文件thesis.pdf或picture.jpg
是否有一个命令返回一个程序来打开这个文件?
我知道 command file,但它只返回正确的文件类型(我知道这不是由其在 Linux 中的扩展名指定的)而不是程序。
我期待这样的事情:
$ program 'picture.jpg'
gimp, gwenview, eog
Run Code Online (Sandbox Code Playgroud)
mimeopen -a 'picture.jpg'
这就是你需要的
它会给你这样的输出
Please choose an application
1) Shotwell Viewer (shotwell-viewer)
2) Firefox Web Browser (firefox)
3) Image Viewer (eog)
Run Code Online (Sandbox Code Playgroud)