← 返回命令列表

Linux command

mimeopen. 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Open file with default application

mimeopen [file.pdf]

Ask which application

mimeopen --ask [file.pdf]

Set the default application

mimeopen -d [file.pdf]

Open without asking

mimeopen --no-ask [file.pdf]

Determine MIME type by file content only

mimeopen -M [file]

Enable debug output

mimeopen -D [file]

说明

mimeopen tries to determine the mimetype of a file and open it with the default desktop application. If no default application is configured, the user is presented with a terminal menu to choose one. The tool is part of the File::MimeInfo Perl module (perl-file-mimeinfo package). It reads and respects XDG MIME associations configured in `~/.config/mimeapps.list` and system defaults.

参数

-a, --ask
Prompt to choose an application from known handlers. Does not change the default application.
-d, --ask-default
Let the user choose a new default program for given files.
-n, --no-ask
Do not ask the user which program to use. Choose the default program or the first program known to handle the file mimetype. Does not set the default application.
-M, --magic-only
Do not check for extensions, globs, or inode type, only look at the content of the file.
--database _mimedir:mimedir:..._
Force the program to look in these directories for the shared mime-info database.
-D, --debug
Print debug information about how the mimetype was determined.
-h, --help
Display help information.
-u, --usage
Display usage information.
-v, --version
Print program version.

FAQ

What is the mimeopen. command used for?

mimeopen tries to determine the mimetype of a file and open it with the default desktop application. If no default application is configured, the user is presented with a terminal menu to choose one. The tool is part of the File::MimeInfo Perl module (perl-file-mimeinfo package). It reads and respects XDG MIME associations configured in `~/.config/mimeapps.list` and system defaults.

How do I run a basic mimeopen. example?

Run `mimeopen [file.pdf]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --ask do in mimeopen.?

Prompt to choose an application from known handlers. Does not change the default application.