GIO(1)

  .SH "NAME" gio - GIO commandline tool
  .SH "SYNOPSIS"
    .HP u
      gio
       help
       [COMMAND]

    .HP u
      gio
       version

    .HP u
      gio
       cat
       LOCATION...

    .HP u
      gio
       copy
       [OPTION...]
       SOURCE...
       DESTINATION

    .HP u
      gio
       info
       [OPTION...]
       LOCATION...

    .HP u
      gio
       launch
       DESKTOP-FILE
       [FILE-ARG...]

    .HP u
      gio
       list
       [OPTION...]
       [LOCATION...]

    .HP u
      gio
       mime
       MIMETYPE
       [HANDLER]

    .HP u
      gio
       mkdir
       [OPTION...]
       LOCATION...

    .HP u
      gio
       monitor
       [OPTION...]
       [LOCATION...]

    .HP u
      gio
       mount
       [OPTION...]
       [LOCATION...]

    .HP u
      gio
       move
       [OPTION...]
       SOURCE...
       DESTINATION

    .HP u
      gio
       open
       LOCATION...

    .HP u
      gio
       rename
       LOCATION
       NAME

    .HP u
      gio
       remove
       [OPTION...]
       LOCATION...

    .HP u
      gio
       save
       [OPTION...]
       DESTINATION

    .HP u
      gio
       set
       [OPTION...]
       LOCATION
       ATTRIBUTE
       VALUE...

    .HP u
      gio
       trash
       [OPTION...]
       [LOCATION...]

    .HP u
      gio
       tree
       [OPTION...]
       [LOCATION...]

  .SH "DESCRIPTION"

    .PP 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.
    .PP 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.

  .SH "COMMANDS"

      .PP help [COMMAND]

              Displays a short synopsis of the available commands or provides detailed help on a specific command.

          .RE
          .PP version

                  Prints the GLib version to which gio belongs.

              .RE
              .PP cat LOCATION...

                      Concatenates the given files and prints them to the standard output.

                      The cat command works just like the traditional cat utility.

                      Note: just pipe through cat if you need its formatting options like -n, -T or other.

                  .RE
                  .PP copy [OPTION...] SOURCE... DESTINATION

                          Copies one or more files from SOURCE to DESTINATION. If more than one source is specified, the destination must be a directory.

                          The copy command is similar to the traditional cp utility.
                          .sp
                Options

                                  .PP -T, --no-target-directory

                                        Don’t copy into DESTINATION even if it is a directory.
                                      .RE
                                      .PP -p, --progress

                                            Show progress.
                                          .RE
                                          .PP -i, --interactive

                                                Prompt for confirmation before overwriting files.
                                              .RE
                                              .PP --preserve

                                                    Preserve all attributes of copied files.
                                                  .RE
                                                  .PP -b, --backup

                                                        Create backups of existing destination files.
                                                      .RE
                                                      .PP -P, --no-dereference

                                                            Never follow symbolic links.
                                                          .RE
                                                          .PP --default-permissions

                                                                Use the default permissions of the current process for the destination file, rather than copying the permissions of the source file.
                                                              .RE
                                                            .sp
                                                          .RE

                                                      .RE
                                                      .PP info [OPTION...] LOCATION...

                                                              Shows information about the given locations.

                                                              The info command is similar to the traditional ls utility.
                                                              .sp
                                                    Options

                                                                      .PP -w, --query-writable

                                                                            List writable attributes.
                                                                          .RE
                                                                          .PP -f, --filesystem

                                                                                Show information about the filesystem that the given locations reside on.
                                                                              .RE
                                                                              .PP -a --attributes=ATTRIBUTES

                                                                                    The attributes to get.

                                                                                      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 comma.

                                                                                      By default, all attributes are listed.
                                                                                  .RE
                                                                                  .PP -n, --nofollow-symlinks

                                                                                        Don’t follow symbolic links.
                                                                                      .RE
                                                                                    .sp
                                                                                  .RE

                                                                              .RE
                                                                              .PP launch DESKTOP-FILE [FILE-ARG...]

                                                                                      Launch a desktop file from any location given.

                                                                                      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.

                                                                                  .RE
                                                                                  .PP list [OPTION...] [LOCATION...]

                                                                                          Lists the contents of the given locations. If no location is given, the contents of the current directory are shown.

                                                                                          The list command is similar to the traditional ls utility.
                                                                                          .sp
                                                                                Options

                                                                                                  .PP -a --attributes=ATTRIBUTES

                                                                                                        The attributes to get.

                                                                                                          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 comma.

                                                                                                          By default, all attributes are listed.
                                                                                                      .RE
                                                                                                      .PP -h, --hidden

                                                                                                            Show hidden files.
                                                                                                          .RE
                                                                                                          .PP -l, --long

                                                                                                                Use a long listing format.
                                                                                                              .RE
                                                                                                              .PP -n, --nofollow-symlinks

                                                                                                                    Don’t follow symbolic links.
                                                                                                                  .RE
                                                                                                                  .PP -d, --print-display-names

                                                                                                                        Print display names.
                                                                                                                      .RE
                                                                                                                      .PP -u, --print-uris

                                                                                                                            Print full URIs.
                                                                                                                          .RE
                                                                                                                        .sp
                                                                                                                      .RE

                                                                                                                  .RE
                                                                                                                  .PP mime MIMETYPE [HANDLER]

                                                                                                                          If no handler is given, the mime command lists the registered and recommended applications for the mimetype. If a handler is given, it is set as the default handler for the mimetype.

                                                                                                                          Handlers must be specified by their desktop file name, including the extension. Example: org.gnome.gedit.desktop.

                                                                                                                      .RE
                                                                                                                      .PP mkdir [OPTION...] LOCATION...

                                                                                                                              Creates directories.

                                                                                                                              The mkdir command is similar to the traditional mkdir utility.
                                                                                                                              .sp
                                                                                                                    Options

                                                                                                                                      .PP -p, --parent

                                                                                                                                            Create parent directories when necessary.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP monitor [OPTION...] [LOCATION...]

                                                                                                                                      Monitors files or directories for changes, such as creation deletion, content and attribute changes, and mount and unmount operations affecting the monitored locations.

                                                                                                                                      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.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -d, --dir=LOCATION

                                                                                                                                            Monitor the given location as a directory. Normally, the file type is used to determine whether to monitor a file or directory.
                                                                                                                                          .RE
                                                                                                                                          .PP -f, --file=LOCATION

                                                                                                                                            Monitor the given location as a file. Normally, the file type is used to determine whether to monitor a file or directory.
                                                                                                                                          .RE
                                                                                                                                          .PP -D, --direct=LOCATION

                                                                                                                                            Monitor the file directly. This allows changes made via hardlinks to be captured.
                                                                                                                                          .RE
                                                                                                                                          .PP -s, --silent=LOCATION

                                                                                                                                            Monitor the file directly, but don’t report changes.
                                                                                                                                          .RE
                                                                                                                                          .PP -n, --no-moves

                                                                                                                                            Report moves and renames as simple deleted/created events.
                                                                                                                                          .RE
                                                                                                                                          .PP -m, --mounts

                                                                                                                                            Watch for mount events.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP mount [OPTION...] [LOCATION...]

                                                                                                                                      Provides commandline access to various aspects of GIO’s mounting functionality.

                                                                                                                                      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.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -m, --mountable

                                                                                                                                            Mount as mountable.
                                                                                                                                          .RE
                                                                                                                                          .PP -d, --device=ID

                                                                                                                                            Mount volume with device file, or other identifier.
                                                                                                                                          .RE
                                                                                                                                          .PP -u, --unmount

                                                                                                                                            Unmount the location.
                                                                                                                                          .RE
                                                                                                                                          .PP -e, --eject

                                                                                                                                            Eject the location.
                                                                                                                                          .RE
                                                                                                                                          .PP -t, --stop=DEVICE

                                                                                                                                            Stop drive with device file.
                                                                                                                                          .RE
                                                                                                                                          .PP -s, --unmount-scheme=SCHEME

                                                                                                                                            Unmount all mounts with the given scheme.
                                                                                                                                          .RE
                                                                                                                                          .PP -f, --force

                                                                                                                                            Ignore outstanding file operations when unmounting or ejecting.
                                                                                                                                          .RE
                                                                                                                                          .PP -a, --anonymous

                                                                                                                                            Use an anonymous user when authenticating.
                                                                                                                                          .RE
                                                                                                                                          .PP -l, --list

                                                                                                                                            List all GIO mounts.
                                                                                                                                          .RE
                                                                                                                                          .PP -o, --monitor

                                                                                                                                            Monitor mount-related events.

                                                                                                                                          .RE
                                                                                                                                          .PP -i, --detail

                                                                                                                                            Show extra information.

                                                                                                                                          .RE
                                                                                                                                          .PP --tcrypt-pim

                                                                                                                                            The numeric PIM when unlocking a VeraCrypt volume.

                                                                                                                                          .RE
                                                                                                                                          .PP --tcrypt-hidden

                                                                                                                                            Mount a TCRYPT hidden volume.

                                                                                                                                          .RE
                                                                                                                                          .PP --tcrypt-system

                                                                                                                                            Mount a TCRYPT system volume.

                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP move [OPTION...] SOURCE... DESTINATION

                                                                                                                                      Moves one or more files from SOURCE to DESTINATION. If more than one source is specified, the destination must be a directory.

                                                                                                                                      The move command is similar to the traditional mv utility.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -T, --no-target-directory

                                                                                                                                            Don’t copy into DESTINATION even if it is a directory.
                                                                                                                                          .RE
                                                                                                                                          .PP -p, --progress

                                                                                                                                            Show progress.
                                                                                                                                          .RE
                                                                                                                                          .PP -i, --interactive

                                                                                                                                            Prompt for confirmation before overwriting files.
                                                                                                                                          .RE
                                                                                                                                          .PP -b, --backup

                                                                                                                                            Create backups of existing destination files.
                                                                                                                                          .RE
                                                                                                                                          .PP -C, --no-copy-fallback

                                                                                                                                            Don’t use copy and delete fallback.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP open LOCATION...

                                                                                                                                      Opens files with the default application that is registered to handle files of this type.

                                                                                                                                      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 mimetype.

                                                                                                                                      Environment variables will not be set on the application, as it may be an existing process which is activated to handle the new file.

                                                                                                                                  .RE
                                                                                                                                  .PP rename LOCATION NAME

                                                                                                                                      Renames a file.

                                                                                                                                      The rename command is similar to the traditional rename utility.

                                                                                                                                  .RE
                                                                                                                                  .PP remove [OPTION...] LOCATION...

                                                                                                                                      Deletes each given file.

                                                                                                                                      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.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -f, --force

                                                                                                                                            Ignore non-existent and non-deletable files.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP save [OPTION...] DESTINATION

                                                                                                                                      Reads from standard input and saves the data to the given location.

                                                                                                                                      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.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -b, --backup

                                                                                                                                            Back up existing destination files.
                                                                                                                                          .RE
                                                                                                                                          .PP -c, --create

                                                                                                                                            Only create the destination if it doesn’t exist yet.
                                                                                                                                          .RE
                                                                                                                                          .PP -a, --append

                                                                                                                                            Append to the end of the file.
                                                                                                                                          .RE
                                                                                                                                          .PP -p, --private

                                                                                                                                            When creating, restrict access to the current user.
                                                                                                                                          .RE
                                                                                                                                          .PP -u, --unlink

                                                                                                                                            When replacing, replace as if the destination did not exist.
                                                                                                                                          .RE
                                                                                                                                          .PP -v, --print-etag

                                                                                                                                            Print the new ETag in the end.
                                                                                                                                          .RE
                                                                                                                                          .PP -e, --etag=ETAG

                                                                                                                                            The ETag of the file that is overwritten.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP set LOCATION ATTRIBUTE VALUE...

                                                                                                                                      Sets a file attribute on a file.

                                                                                                                                      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.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -t, --type=TYPE

                                                                                                                                            Specifies the type of the attribute. Supported types are string, stringv, bytestring, boolean, uint32, int32, uint64, int64 and unset.

                                                                                                                                              If the type is not specified, string is assumed.

                                                                                                                                          .RE
                                                                                                                                          .PP -d, --delete

                                                                                                                                            Unsets an attribute (same as setting it's type to unset).
                                                                                                                                          .RE
                                                                                                                                          .PP -n, --nofollow-symlinks

                                                                                                                                            Don’t follow symbolic links.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP trash [OPTION...] [LOCATION...]

                                                                                                                                      Sends files or directories to the ‘Trashcan’ or restore them from ‘Trashcan’. This can be a different folder depending on where the file is located, and not all file systems support this concept. In the common case that the file lives inside a user’s home directory, the trash folder is $XDG_DATA_HOME/Trash.

                                                                                                                                      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://.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -f, --force

                                                                                                                                            Ignore non-existent and non-deletable files.
                                                                                                                                          .RE
                                                                                                                                          .PP --empty

                                                                                                                                            Empty the trash.
                                                                                                                                          .RE
                                                                                                                                          .PP --list

                                                                                                                                            List files in the trash with their original locations
                                                                                                                                          .RE
                                                                                                                                          .PP --restore

                                                                                                                                            Restore a file from trash to its original location. A URI beginning with trash:// is expected here. If the original directory doesn't exist, it will be recreated.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE
                                                                                                                                  .PP tree [OPTION...] [LOCATION...]

                                                                                                                                      Lists the contents of the given locations recursively, in a tree-like format. If no location is given, it defaults to the current directory.

                                                                                                                                      The tree command is similar to the traditional tree utility.
                                                                                                                                      .sp
                                                                                                                            Options

                                                                                                                                          .PP -h, --hidden

                                                                                                                                            Show hidden files.
                                                                                                                                          .RE
                                                                                                                                          .PP -l, --follow-symlinks

                                                                                                                                            Follow symbolic links.
                                                                                                                                          .RE
                                                                                                                                        .sp
                                                                                                                                      .RE

                                                                                                                                  .RE

                                                                                                                              .SH "EXIT STATUS"

                                                                                                                                .PP On success 0 is returned, a non-zero failure code otherwise.

                                                                                                                              .SH "SEE ALSO"

                                                                                                                                .PP cat(1), cp(1), ls(1), mkdir(1), mv(1), rm(1), tree(1).