LinuxCommandLibrary

gio

TLDR

Open a file with the default application

$ gio open [path/to/file]
copy
List files in a directory
$ gio list [path/to/directory]
copy
Show information about a file
$ gio info [path/to/file]
copy
Copy a file
$ gio copy [path/to/source] [path/to/destination]
copy
Send a file to the trash (reversible)
$ gio trash [path/to/file]
copy
Launch an application from a .desktop file
$ gio launch [path/to/file].desktop
copy

SYNOPSIS

gio command [arguments]

DESCRIPTION

gio is the GIO command-line tool for file operations in GNOME-based systems. It provides a unified interface for both local files and virtual filesystems (GVfs), including network locations, trash, and removable media.
Unlike standard Unix commands, gio integrates with GNOME's infrastructure, respecting desktop settings for default applications, trash behavior, and virtual filesystem mounts. It can access locations like smb://, sftp://, mtp://, and trash://.
The tool replaces older utilities like gvfs-open, gvfs-copy, and gvfs-trash.

PARAMETERS

open FILE

Open file with default application
list DIR
List contents of directory
info FILE
Display information about a file
copy SRC DEST
Copy files
move SRC DEST
Move files
trash FILE
Move file to trash
remove FILE
Delete file permanently
cat FILE
Display file contents
launch DESKTOP
Launch application from .desktop file
mime FILE
Get or set MIME type handler
mount LOCATION
Mount a location

CAVEATS

Requires GLib and GVfs to be properly installed. Some virtual filesystem operations require the gvfsd daemon running. Performance may be slower than native commands for local file operations.

HISTORY

gio was introduced in GLib 2.50 (2016) as a unified command-line interface for GIO operations, consolidating various gvfs-* utilities into a single tool with subcommands. It's part of the GNOME platform's modern approach to file handling.

SEE ALSO

xdg-open(1), gvfs(7), nautilus(1)

Copied to clipboard