So they are consistent with the way we’re building man pages in other
projects, and because some people are allergic to XML.
This changes the build-time dependencies from `xsltproc` to `rst2man`,
and also takes the opportunity to change the `-Dman` Meson option from a
boolean to a feature (so you should use `-Dman-pages={enabled,disabled}`
now, rather than `-Dman={true,false}`).
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3037
14 KiB
gio
GIO commandline tool
SYNOPSIS
**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
Displays a short synopsis of the available commands or provides detailed help on a specific command.
version
Prints the GLib version to which
giobelongs.
cat LOCATION…
Concatenates the given files and prints them to the standard output.
The
catcommand works just like the traditionalcatutility.Mote: just pipe through
catif you need its formatting options like-n,-Tor other.
copy [OPTION…] SOURCE…
DESTINATION
Copies one or more files from
SOURCEtoDESTINATION. If more than one source is specified, the destination must be a directory.The
copycommand is similar to the traditionalcputility.Options
-T,--no-target-directoryDon’t copy into
DESTINATIONeven if it is a directory.
-p,--progressShow progress.
-i,--interactivePrompt for confirmation before overwriting files.
--preservePreserve all attributes of copied files.
-b,--backupCreate backups of existing destination files.
-P,--no-dereferenceNever follow symbolic links.
--default-permissionsUse the default permissions of the current process for the destination file, rather than copying the permissions of the source file.
info [OPTION…] LOCATION…
Shows information about the given locations.
The
infocommand is similar to the traditionallsutility.Options
-w,--query-writableList writable attributes.
-f,--filesystemShow information about the filesystem that the given locations reside on.
-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 commas.By default, all attributes are listed.
-n,--nofollow-symlinksDon’t follow symbolic links.
launch DESKTOP-FILE [FILE-ARG…]
Launch a desktop file from any location given.
The
launchcommand extends the behavior of theopencommand by allowing any desktop file to be launched, not only those registered as file handlers.
list [OPTION…] [LOCATION…]
Lists the contents of the given locations. If no location is given, the contents of the current directory are shown.
The
listcommand is similar to the traditionallsutility.Options
-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 commas.By default, all attributes are listed.
-h,--hiddenShow hidden files.
-l,--longUse a long listing format.
-n,--nofollow-symlinksDon’t follow symbolic links.
-d,--print-display-namesPrint display names.
-u,--print-urisPrint full URIs.
mime MIME-TYPE [HANDLER]
If no handler is given, the
mimecommand lists the registered and recommended applications for the MIME type. If a handler is given, it is set as the default handler for the MIME type.Handlers must be specified by their desktop file name, including the extension. Example:
org.gnome.gedit.desktop.
mkdir [OPTION…] LOCATION…
Creates directories.
The
mkdircommand is similar to the traditionalmkdirutility.Options
-p,--parentCreate parent directories when necessary.
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
monitorcommand 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>Monitor the given location as a directory. Normally, the file type is used to determine whether to monitor as a file or as a directory.
-f,--file=<LOCATION>Monitor the given location as a file. Normally, the file type is used to determine whether to monitor as a file or as a directory.
-D,--direct=<LOCATION>Monitor the file directly. This allows changes made via hardlinks to be captured.
-s,--silent=<LOCATION>Monitor the file directly, but don’t report changes.
-n,--no-movesReport moves and renames as simple deleted/created events.
-m,--mountsWatch for mount events.
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
mountcommand may ask for user IDs, passwords, and so on, when required.Options
-m,--mountableMount as mountable.
-d,--device=<ID>Mount volume with device file, or other identifier.
-u,--unmountUnmount the location.
-e,--ejectEject the location.
-t,--stop=<DEVICE>Stop drive with device file.
-s,--unmount-scheme=<SCHEME>Unmount all mounts with the given scheme.
-f,--forceIgnore outstanding file operations when unmounting or ejecting.
-a,--anonymousUse an anonymous user when authenticating.
-l,--listList all GIO mounts.
-o,--monitorMonitor mount-related events.
-i,--detailShow extra information.
--tcrypt-pimThe numeric PIM when unlocking a VeraCrypt volume.
--tcrypt-hiddenMount a TCRYPT hidden volume.
--tcrypt-systemMount a TCRYPT system volume.
move [OPTION…] SOURCE…
DESTINATION
Moves one or more files from
SOURCEtoDESTINATION. If more than one source is specified, the destination must be a directory.The
movecommand is similar to the traditionalmvutility.Options
-T,--no-target-directoryDon’t copy into
DESTINATIONeven if it is a directory.
-p,--progressShow progress.
-i,--interactivePrompt for confirmation before overwriting files.
-b,--backupCreate backups of existing destination files.
-C,--no-copy-fallbackDon’t use copy and delete fallback.
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
mimecommand 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
Renames a file.
The
renamecommand is similar to the traditionalrenameutility.
remove [OPTION…] LOCATION…
Deletes each given file.
This command removes files irreversibly. If you want a reversible way to remove files, see the
trashcommand.Note that not all URI schemes that are supported by GIO may allow deletion of files.
The
removecommand is similar to the traditionalrmutility.Options
-f,--forceIgnore non-existent and non-deletable files.
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
savecommand allows saving to location that GIO can write to.Options
-b,--backupBack up existing destination files.
-c,--createOnly create the destination if it doesn’t exist yet.
-a,--appendAppend to the end of the file.
-p,--privateWhen creating, restrict access to the current user.
-u,--unlinkWhen replacing, replace as if the destination did not exist.
-v,--print-etagPrint the new ETag in the end.
-e,--etag=<ETAG>The ETag of the file that is overwritten.
set [OPTION…] 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-writableoption of theinfocommand to list writable file attributes.If the
TYPEis unset,VALUEdoes not have to be specified. If theTYPEisstringv, multiple values can be given.Options
-t,--type=<TYPE>Specifies the type of the attribute. Supported types are
string,stringv,bytestring,boolean,uint32,int32,uint64,int64andunset.If the type is not specified,
stringis assumed.
-d,--deleteUnsets an attribute (same as setting its type to
unset).
-n,--nofollow-symlinksDon’t follow symbolic links.
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
removecommand.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 --listorgio list trash://.Options
-f,--forceIgnore non-existent and non-deletable files.
--emptyEmpty the trash.
--listList files in the trash with their original locations.
--restoreRestore 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.
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
treecommand is similar to the traditionaltreeutility.Options
-h,--hiddenShow hidden files.
-l,--follow-symlinksFollow symbolic links.
EXIT STATUS
On success, 0 is returned, a non-zero failure code
otherwise.