LinuxCommandLibrary

gvfs-open

Open files with their associated application

SYNOPSIS

gvfs-open [OPTION...] [URI...]

PARAMETERS

--help
    Display help and exit

--version
    Output version information and exit

DESCRIPTION

gvfs-open is a command-line tool from the GVFS (GNOME Virtual File System) package, designed to open files, directories, or URIs using the desktop environment's default applications. It supports local paths and remote URIs like smb://, ftp://, or trash://, leveraging GVFS backends for seamless access without manual mounting.

This utility integrates with MIME-type associations to launch appropriate programs, such as image viewers for photos or web browsers for HTML files. If no URI is specified, it defaults to opening the current working directory in the file manager.

Ideal for scripts or terminal workflows in GNOME-based environments, it provides a standards-compliant alternative to older tools. It relies on the GVFS daemon (gvfsd) running in the session, ensuring virtual filesystem operations. Multiple URIs can be passed, opening each in sequence.

While simple, it's powerful for automation, e.g., gvfs-open document.pdf instantly displays the PDF. Exit status indicates success (0) or partial failure (1), useful for scripting.

CAVEATS

Requires running GVFS daemon; limited outside GNOME/KDE with GVFS support. Does not block; returns immediately after launching apps.

DEFAULT BEHAVIOR

No URI opens current directory in file manager.

EXIT STATUS

0: all URIs opened
1: some URIs failed

HISTORY

Introduced in GVFS 0.1 (2008) with GNOME 2.24. Maintained for compatibility; gio open is the modern preferred command since GIO 2.50.

SEE ALSO

gio(1), xdg-open(1), gnome-open(1)

Copied to clipboard