table of contents
GIO() | GIO() |
NAME¶
gio - GIO commandline tool
SYNOPSIS¶
gio help [COMMAND] gio version gio cat LOCATION… gio copy [OPTION…] SOURCE… DESTINATION gio info [OPTION…] LOCATION… gio launch DESKTOP-FILE [FILE-ARG…] gio list [OPTION…] [LOCATION…] gio mime MIME-TYPE [HANDLER] gio mkdir [OPTION…] LOCATION… gio monitor [OPTION…] [LOCATION…] gio mount [OPTION…] [LOCATION…] gio move [OPTION…] SOURCE… DESTINATION gio open LOCATION… gio rename LOCATION NAME gio remove [OPTION…] LOCATION… gio save [OPTION…] DESTINATION gio set [OPTION…] LOCATION ATTRIBUTE VALUE… gio trash [OPTION…] [LOCATION…] gio tree [OPTION…] [LOCATION…]
DESCRIPTION¶
gio is a utility that makes many of the GIO features available from the commandline. In doing so, it provides commands that are similar to traditional utilities, but let you use GIO locations instead of local files: for example you can use something like smb://server/resource/file.txt as a location.
Plain filenames which contain a colon will be interpreted as URIs with an unknown protocol. To avoid this, prefix them with a path such as ./, or with the file: protocol.
COMMANDS¶
help COMMAND
version
cat LOCATION…
The cat command works just like the traditional cat utility.
Mote: just pipe through cat if you need its formatting options like -n, -T or other.
copy [OPTION…] SOURCE… DESTINATION
The copy command is similar to the traditional cp utility.
Options
-T, --no-target-directory
-p, --progress
-i, --interactive
--preserve
-b, --backup
-P, --no-dereference
--default-permissions
info [OPTION…] LOCATION…
The info command is similar to the traditional ls utility.
Options
-w, --query-writable
-f, --filesystem
-a, --attributes=<ATTRIBUTES>
Attributes can be specified with their GIO name, e.g. standard::icon, or just by namespace, e.g. unix, or by *, which matches all attributes. Several attributes or groups of attributes can be specified, separated by commas.
By default, all attributes are listed.
-n, --nofollow-symlinks
launch DESKTOP-FILE [FILE-ARG…]
The launch command extends the behavior of the open command by allowing any desktop file to be launched, not only those registered as file handlers.
list [OPTION…] [LOCATION…]
The list command is similar to the traditional ls utility.
Options
-a, --attributes=<ATTRIBUTES>
Attributes can be specified with their GIO name, e.g. standard::icon, or just by namespace, e.g. unix, or by *, which matches all attributes. Several attributes or groups of attributes can be specified, separated by commas.
By default, all attributes are listed.
-h, --hidden
-l, --long
-n, --nofollow-symlinks
-d, --print-display-names
-u, --print-uris
mime MIME-TYPE [HANDLER]
Handlers must be specified by their desktop file name, including the extension. Example: org.gnome.gedit.desktop.
mkdir [OPTION…] LOCATION…
The mkdir command is similar to the traditional mkdir utility.
Options
-p, --parent
monitor [OPTION…] [LOCATION…]
The monitor command uses the GIO file monitoring APIs to do its job. GIO has different implementations for different platforms. The most common implementation on Linux uses inotify.
Options
-d, --dir=<LOCATION>
-f, --file=<LOCATION>
-D, --direct=<LOCATION>
-s, --silent=<LOCATION>
-n, --no-moves
-m, --mounts
mount [OPTION…] [LOCATION…]
Mounting refers to the traditional concept of arranging multiple file systems and devices in a single tree, rooted at /. Classical mounting happens in the kernel and is controlled by the mount utility. GIO expands this concept by introducing mount daemons that can make file systems available to GIO applications without kernel involvement.
GIO mounts can require authentication, and the mount command may ask for user IDs, passwords, and so on, when required.
Options
-m, --mountable
-d, --device=<ID>
-u, --unmount
-e, --eject
-t, --stop=<DEVICE>
-s, --unmount-scheme=<SCHEME>
-f, --force
-a, --anonymous
-l, --list
-o, --monitor
-i, --detail
--tcrypt-pim
--tcrypt-hidden
--tcrypt-system
move [OPTION…] SOURCE… DESTINATION
The move command is similar to the traditional mv utility.
Options
-T, --no-target-directory
-p, --progress
-i, --interactive
-b, --backup
-C, --no-copy-fallback
open LOCATION…
GIO obtains this information from the shared-mime-info database, with per-user overrides stored in $XDG_DATA_HOME/applications/mimeapps.list.
The mime command can be used to change the default handler for a MIME type.
Environment variables will not be set on the application, as it may be an existing process which is activated to handle the new file.
rename LOCATION NAME
The rename command is similar to the traditional rename utility.
remove [OPTION…] LOCATION…
This command removes files irreversibly. If you want a reversible way to remove files, see the trash command.
Note that not all URI schemes that are supported by GIO may allow deletion of files.
The remove command is similar to the traditional rm utility.
Options
-f, --force
save [OPTION…] DESTINATION
This is similar to just redirecting output to a file using traditional shell syntax, but the save command allows saving to location that GIO can write to.
Options
-b, --backup
-c, --create
-a, --append
-p, --private
-u, --unlink
-v, --print-etag
-e, --etag=<ETAG>
set [OPTION…] LOCATION ATTRIBUTE VALUE…
File attributes can be specified with their GIO name, e.g standard::icon. Note that not all GIO file attributes are writable. Use the --query-writable option of the info command to list writable file attributes.
If the TYPE is unset, VALUE does not have to be specified. If the TYPE is stringv, multiple values can be given.
Options
-t, --type=<TYPE>
If the type is not specified, string is assumed.
-d, --delete
-n, --nofollow-symlinks
trash [OPTION…] [LOCATION…]
Note that moving files to the trash does not free up space on the file system until the ‘Trashcan’ is emptied. If you are interested in deleting a file irreversibly, see the remove command.
Inspecting and emptying the ‘Trashcan’ is normally supported by graphical file managers such as Nautilus, but you can also see the trash with the command: gio trash --list or gio list trash://.
Options
-f, --force
--empty
--list
--restore
tree [OPTION…] [LOCATION…]
The tree command is similar to the traditional tree utility.
Options
-h, --hidden
-l, --follow-symlinks
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO¶
<cat(1)> , <cp(1)> , <ls(1)> ,
<mkdir(1)> , <mv(1)> , <rm(1)> ,
<tree(1)>