gvfs-open
Open files with their associated application
SYNOPSIS
gvfs-open [OPTION...] LOCATION...
PARAMETERS
-a, --app=APPLICATION
Specifies an APPLICATION to open the LOCATION(s) with, overriding the default associated application. For example, --app=gimp to open an image with GIMP.
-L, --launch-only
Launches the application and immediately exits, without waiting for the application to finish or close.
-P, --print-uri
Prints the URI of the opened resource to standard output. This can be useful in scripting to get the canonical URI after opening.
-h, --help
Displays a help message with available options and general usage information for the command.
--version
Outputs the version information for the GIO library, which gvfs-open relies upon.
DESCRIPTION
The gvfs-open command is a utility from the GVFS (GNOME Virtual File System) suite, primarily designed for the GNOME desktop environment. Its core function is to open local files, directories, or various types of URIs (Uniform Resource Identifiers) using the user's preferred default application.
While named gvfs-open, it is typically a convenience symlink or wrapper to the more general gio open command, which is part of the GIO (Glib Input/Output) library. Therefore, its functionality and options are inherited directly from gio open.
It seamlessly handles diverse URI schemes such as http://, ftp://, sftp://, and smb://, allowing users to interact with remote resources as if they were local files. gvfs-open determines the correct application to launch by querying the GNOME desktop environment's MIME type and application associations. It's often used internally by GNOME applications to ensure consistent and intuitive file and URI handling.
CAVEATS
The gvfs-open command is primarily designed for and most effective within GNOME or GTK+-based desktop environments, as it relies on GVFS and GNOME's desktop integration. In non-GNOME environments, it might not be present or function as expected; xdg-open is a more universal alternative for cross-desktop file opening.
As a symlink to gio, its behavior and available options are entirely dependent on the gio open subcommand. If gio itself is not installed or configured correctly, gvfs-open will not function.
UNDERLYING COMMAND
It's crucial to understand that gvfs-open is typically a direct symlink to the gio executable, specifically executing its 'open' subcommand. This means that all parameters, capabilities, and underlying mechanisms are derived from gio open. When you run gvfs-open, you are effectively running gio open.
DESKTOP INTEGRATION
This command leverages the rich desktop integration provided by GNOME. It consults the system's MIME type database and the user's default application preferences (often configured via the GNOME Control Center or file manager) to intelligently launch the correct application for a given file type or URI scheme. This makes it a key component in how GNOME applications handle external resources seamlessly.
HISTORY
gvfs-open emerged as part of the GVFS (GNOME Virtual File System) project, which was developed to replace the older GnomeVFS in GNOME. GVFS provides a robust, user-space virtual filesystem layer, enabling applications to transparently access various remote resources (like FTP, SFTP, SMB, HTTP) as if they were local files.
The underlying mechanism, GIO (Glib Input/Output), is a crucial part of the GLib library, providing a modern and asynchronous I/O API. gvfs-open was introduced as a convenient wrapper or symlink to the gio open command, simplifying file and URI handling for end-users within the GNOME desktop environment, ensuring consistent behavior with user preferences and desktop integration settings.