2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 <productname>GIO</productname>
9 <contrib>Developer</contrib>
10 <firstname>Matthias</firstname>
11 <surname>Clasen</surname>
12 <email>mclasen@redhat.com</email>
18 <refentrytitle>gio</refentrytitle>
19 <manvolnum>1</manvolnum>
20 <refmiscinfo class="manual">User Commands</refmiscinfo>
24 <refname>gio</refname>
25 <refpurpose>GIO commandline tool</refpurpose>
30 <command>gio</command>
31 <arg choice="plain">help</arg>
32 <arg choice="opt"><replaceable>COMMAND</replaceable></arg>
35 <command>gio</command>
36 <arg choice="plain">version</arg>
39 <command>gio</command>
40 <arg choice="plain">cat</arg>
41 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
44 <command>gio</command>
45 <arg choice="plain">copy</arg>
46 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
47 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg>
48 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
51 <command>gio</command>
52 <arg choice="plain">info</arg>
53 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
54 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
57 <command>gio</command>
58 <arg choice="plain">list</arg>
59 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
60 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
63 <command>gio</command>
64 <arg choice="plain">mime</arg>
65 <arg choice="plain"><replaceable>MIMETYPE</replaceable></arg>
66 <arg choice="opt"><replaceable>HANDLER</replaceable></arg>
69 <command>gio</command>
70 <arg choice="plain">mkdir</arg>
71 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
72 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
75 <command>gio</command>
76 <arg choice="plain">monitor</arg>
77 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
78 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
81 <command>gio</command>
82 <arg choice="plain">mount</arg>
83 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
84 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
87 <command>gio</command>
88 <arg choice="plain">move</arg>
89 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
90 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg>
91 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
94 <command>gio</command>
95 <arg choice="plain">open</arg>
96 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
99 <command>gio</command>
100 <arg choice="plain">rename</arg>
101 <arg choice="plain"><replaceable>LOCATION</replaceable></arg>
102 <arg choice="plain"><replaceable>NAME</replaceable></arg>
105 <command>gio</command>
106 <arg choice="plain">remove</arg>
107 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
108 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
111 <command>gio</command>
112 <arg choice="plain">save</arg>
113 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
114 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
117 <command>gio</command>
118 <arg choice="plain">set</arg>
119 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
120 <arg choice="plain"><replaceable>LOCATION</replaceable></arg>
121 <arg choice="plain"><replaceable>ATTRIBUTE</replaceable></arg>
122 <arg choice="plain" rep="repeat"><replaceable>VALUE</replaceable></arg>
125 <command>gio</command>
126 <arg choice="plain">trash</arg>
127 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
128 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
131 <command>gio</command>
132 <arg choice="plain">tree</arg>
133 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
134 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
139 <title>Description</title>
140 <para><command>gio</command> is a utility that makes many of the GIO
141 features available from the commandline. In doing so, it provides
142 commands that are similar to traditional utilities, but let you
143 use GIO locations instead of local files: for example you can use
144 something like <filename>smb://server/resource/file.txt</filename>
149 <title>Commands</title>
154 <command>help</command>
155 <arg choice="opt"><replaceable>COMMAND</replaceable></arg>
158 <para>Displays a short synopsis of the available commands or provides
159 detailed help on a specific command.</para>
165 <command>version</command>
168 <para>Prints the GLib version to which <command>gio</command>
175 <command>cat</command>
176 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
179 <para>Concatenates the given files and prints them to the standard
181 <para>The cat command works just like the traditional cat utility.</para>
182 <para>Note: just pipe through cat if you need its formatting options
183 like -n, -T or other.</para>
189 <command>copy</command>
190 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
191 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg>
192 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
195 <para>Copies one or more files from <replaceable>SOURCE</replaceable>
196 to <replaceable>DESTINATION</replaceable>. If more than one source
197 is specified, the destination must be a directory.</para>
198 <para>The copy command is similar to the traditional cp utility.</para>
200 <title>Options</title>
203 <term><option>-T</option>, <option>--no-target-directory</option></term>
204 <listitem><para>Don't copy into <replaceable>DESTINATION</replaceable> even if it is a directory.</para></listitem>
207 <term><option>-p</option>, <option>--progress</option></term>
208 <listitem><para>Show progress.</para></listitem>
211 <term><option>-i</option>, <option>--interactive</option></term>
212 <listitem><para>Prompt for confirmation before overwriting files.</para></listitem>
215 <term><option>--preserve</option></term>
216 <listitem><para>Preserve all attributes of copied files.</para></listitem>
219 <term><option>-b</option>, <option>--backup</option></term>
220 <listitem><para>Create backups of existing destination files.</para></listitem>
223 <term><option>-P</option>, <option>--no-dereference</option></term>
224 <listitem><para>Never follow symbolic links.</para></listitem>
232 <command>info</command>
233 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
234 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
237 <para>Shows information about the given locations.</para>
238 <para>The info command is similar to the traditional ls utility.</para>
240 <title>Options</title>
243 <term><option>-w</option>, <option>--query-writable</option></term>
244 <listitem><para>List writable attributes.</para></listitem>
247 <term><option>-f</option>, <option>--filesystem</option></term>
248 <listitem><para>Show information about the filesystem that the given
249 locations reside on.</para></listitem>
252 <term><option>-a</option> <option>--attributes=<replaceable>ATTRIBUTES</replaceable></option></term>
253 <listitem><para>The attributes to get.</para>
254 <para>Attributes can be specified with their GIO name, e.g.
255 standard::icon, or just by namespace, e.g. unix, or by '*',
256 which matches all attributes. Several attributes or groups
257 of attributes can be specified, separated by comma.</para>
258 <para>By default, all attributes are listed.</para></listitem>
261 <term><option>-n</option>, <option>--nofollow-symlinks</option></term>
262 <listitem><para>Don't follow symbolic links.</para></listitem>
271 <command>list</command>
272 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
273 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
276 <para>Lists the contents of the given locations. If no location is
277 given, the contents of the current directory are shown.</para>
278 <para>The list command is similar to the traditional ls utility.</para>
280 <title>Options</title>
283 <term><option>-a</option> <option>--attributes=<replaceable>ATTRIBUTES</replaceable></option></term>
284 <listitem><para>The attributes to get.</para>
285 <para>Attributes can be specified with their GIO name, e.g.
286 standard::icon, or just by namespace, e.g. unix, or by '*',
287 which matches all attributes. Several attributes or groups
288 of attributes can be specified, separated by comma.</para>
289 <para>By default, all attributes are listed.</para></listitem>
292 <term><option>-h</option>, <option>--hidden</option></term>
293 <listitem><para>Show hidden files.</para></listitem>
296 <term><option>-l</option>, <option>--long</option></term>
297 <listitem><para>Use a long listing format.</para></listitem>
300 <term><option>-n</option>, <option>--nofollow-symlinks</option></term>
301 <listitem><para>Don't follow symbolic links.</para></listitem>
304 <term><option>-u</option>, <option>--print-uris</option></term>
305 <listitem><para>Print full URIs.</para></listitem>
314 <command>mime</command>
315 <arg choice="plain"><replaceable>MIMETYPE</replaceable></arg>
316 <arg choice="opt"><replaceable>HANDLER</replaceable></arg>
319 <para>If no handler is given, the mime command lists the
320 registered and recommended applications for the mimetype.
321 If a handler is given, it is set as the default handler for
323 <para>Handlers must be specified by their desktop file name,
324 including the extension. Example: org.gnome.gedit.desktop.</para>
330 <command>mkdir</command>
331 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
332 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
335 <para>Creates directories.</para>
336 <para>The mkdir command is similar to the traditional mkdir utility.</para>
338 <title>Options</title>
341 <term><option>-p</option>, <option>--parent</option></term>
342 <listitem><para>Create parent directories when necessary.</para></listitem>
351 <command>monitor</command>
352 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
353 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
356 <para>Monitors files or directories for changes, such as creation
357 deletion, content and attribute changes, and mount and unmount
358 operations affecting the monitored locations.</para>
359 <para>The monitor command uses the GIO file monitoring APIs to do
360 its job. GIO has different implementations for different platforms.
361 The most common implementation on Linux uses inotify.</para>
363 <title>Options</title>
366 <term><option>-d</option>, <option>--dir=<replaceable>LOCATION</replaceable></option></term>
367 <listitem><para>Monitor the given location as a directory. Normally,
368 the file type is used to determine whether to monitor a file or directory.</para></listitem>
371 <term><option>-f</option>, <option>--file=<replaceable>LOCATION</replaceable></option></term>
372 <listitem><para>Monitor the given location as a file. Normally,
373 the file type is used to determine whether to monitor a file or directory.</para></listitem>
376 <term><option>-D</option>, <option>--direct=<replaceable>LOCATION</replaceable></option></term>
377 <listitem><para>Monitor the file directly. This allows to capture changes made via hardlinks.</para></listitem>
380 <term><option>-s</option>, <option>--silent=<replaceable>LOCATION</replaceable></option></term>
381 <listitem><para>Monitor the file directly, but don't report changes.</para></listitem>
384 <term><option>-n</option>, <option>--no-moves</option></term>
385 <listitem><para>Report moves and renames as simple deleted/created events.</para></listitem>
388 <term><option>-m</option>, <option>--mounts</option></term>
389 <listitem><para>Watch for mount events.</para></listitem>
398 <command>mount</command>
399 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
400 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
403 <para>Provides commandline access to various aspects of GIOs mounting
404 functionality.</para>
405 <para>Mounting refers to the traditional concept of arranging multiple
406 file systems and devices in a single tree, rooted at /. Classical
407 mounting happens in the kernel and is controlle by the mount utility.
408 GIO expands this concept by introducing mount daemons that can make
409 file systems available to GIO applications without kernel
411 <para>GIO mounts can require authentication, and the mount command
412 may ask for user IDs, passwords, and so on, when required.</para>
414 <title>Options</title>
417 <term><option>-m</option>, <option>--mountable</option></term>
418 <listitem><para>Mount as mountable.</para></listitem>
421 <term><option>-d</option>, <option>--device=<replaceable>DEVICE</replaceable></option></term>
422 <listitem><para>Mount volume with device file.</para></listitem>
425 <term><option>-u</option>, <option>--unmount</option></term>
426 <listitem><para>Unmount the location.</para></listitem>
429 <term><option>-e</option>, <option>--eject</option></term>
430 <listitem><para>Eject the location.</para></listitem>
433 <term><option>-s</option>, <option>--unmount-scheme=<replaceable>SCHEME</replaceable></option></term>
434 <listitem><para>Unmount all mounts with the given scheme.</para></listitem>
437 <term><option>-f</option>, <option>--force</option></term>
438 <listitem><para>Ignore outstanding file operations when unmounting or ejecting.</para></listitem>
441 <term><option>-a</option>, <option>--anonymous</option></term>
442 <listitem><para>Use an anonymous user when authenticating.</para></listitem>
445 <term><option>-l</option>, <option>--list</option></term>
446 <listitem><para>List all GIO mounts.</para></listitem>
449 <term><option>-o</option>, <option>--monitor</option></term>
450 <listitem><para>Monitor mount-related events.</para>
454 <term><option>-i</option>, <option>--detail</option></term>
455 <listitem><para>Show extra information.</para>
459 <term><option>--tcrypt-pim</option></term>
460 <listitem><para>The numeric PIM when unlocking a VeraCrypt volume.</para>
464 <term><option>--tcrypt-hidden</option></term>
465 <listitem><para>Mount a TCRYPT hidden volume.</para>
469 <term><option>--tcrypt-system</option></term>
470 <listitem><para>Mount a TCRYPT system volume.</para>
480 <command>move</command>
481 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
482 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg>
483 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
486 <para>Moves one or more files from <replaceable>SOURCE</replaceable>
487 to <replaceable>DESTINATION</replaceable>. If more than one source
488 is specified, the destination must be a directory.</para>
489 <para>The move command is similar to the traditional mv utility.</para>
495 <command>open</command>
496 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
499 <para>Opens files with the default application that is registered
500 to handle files of this type.</para>
501 <para>GIO obtains this information from the shared-mime-info
502 database, with per-user overrides stored in
503 <filename><envar>$XDG_DATA_HOME</envar>/applications/mimeapps.list</filename>.</para>
504 <para>The mime command can be used to change the default handler for
511 <command>rename</command>
512 <arg choice="plain"><replaceable>LOCATION</replaceable></arg>
513 <arg choice="plain"><replaceable>NAME</replaceable></arg>
516 <para>Renames a file.</para>
517 <para>The rename command is similar to the traditional rename utility.</para>
523 <command>remove</command>
524 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
525 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
528 <para>Deletes each given file.</para>
529 <para>This command removes files irreversibly. If you want a reversible
530 way to remove files, see the trash command.</para>
531 <para>Note that not all URI schemes that are supported by GIO may
532 allow deletion of files.</para>
533 <para> The remove command is similar to the traditional rm utility.</para>
535 <title>Options</title>
538 <term><option>-f</option>, <option>--force</option></term>
539 <listitem><para>Ignore non-existent and non-deletable files.</para></listitem>
548 <command>save</command>
549 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
550 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg>
553 <para>Reads from standard input and saves the data to the given
555 <para>This is similar to just redirecting output to a file using
556 traditional shell syntax, but the save command allows saving to
557 location that GIO can write to.</para>
559 <title>Options</title>
562 <term><option>-b</option>, <option>--backup</option></term>
563 <listitem><para>Backup existing destination files.</para></listitem>
566 <term><option>-c</option>, <option>--create</option></term>
567 <listitem><para>Only create the destination if it doesn't exist yet.</para></listitem>
570 <term><option>-a</option>, <option>--append</option></term>
571 <listitem><para>Append to the end of the file.</para></listitem>
574 <term><option>-p</option>, <option>--private</option></term>
575 <listitem><para>When creating, restrict access to the current user.</para></listitem>
578 <term><option>-u</option>, <option>--unlink</option></term>
579 <listitem><para>When replacing, replace as if the destination did not exist.</para></listitem>
582 <term><option>-v</option>, <option>--print-etag</option></term>
583 <listitem><para>Print the new etag in the end.</para></listitem>
586 <term><option>-e</option>, <option>--etag=<replaceable>ETAG</replaceable></option></term>
587 <listitem><para>The etag of the file that is overwritten.</para></listitem>
596 <command>set</command>
597 <arg choice="plain"><replaceable>LOCATION</replaceable></arg>
598 <arg choice="plain"><replaceable>ATTRIBUTE</replaceable></arg>
599 <arg choice="plain" rep="repeat"><replaceable>VALUE</replaceable></arg>
602 <para>Allows to set a file attribute on a file.</para>
603 <para>File attributes can be specified with their GIO name, e.g
604 standard::icon. Note that not all GIO file attributes are writable.
605 Use the --query-writable option of the info command to list
606 writable file attributes.</para>
607 <para>If the <replaceable>TYPE</replaceable> is unset,
608 <replaceable>VALUE</replaceable> does not have to be specified.
609 If the type is stringv, multiple values can be given.</para>
611 <title>Options</title>
614 <term><option>-t</option>, <option>--type=<replaceable>TYPE</replaceable></option></term>
615 <listitem><para>Specifies the type of the attribute. Supported
616 types are string, stringv, bytestring, boolean, uint32, int32,
617 uint64, int64 and unset.</para>
618 <para>If the type is not specified, string is assumed.</para>
622 <term><option>-n</option>, <option>--nofollow-symlinks</option></term>
623 <listitem><para>Don't follow symbolic links.</para></listitem>
632 <command>trash</command>
633 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
634 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
637 <para>Sends files or directories to the "Trashcan". This can be a
638 different folder depending on where the file is located, and not
639 all file systems support this concept. In the common case that the
640 file lives inside a users home directory, the trash folder is
641 <filename><envar>$XDG_DATA_HOME</envar>/Trash</filename>.</para>
642 <para>Note that moving files to the trash does not free up space on
643 the file system until the "Trashcan" is emptied. If you are interested
644 in deleting a file irreversibly, see the remove command.</para>
645 <para>Inspecting and emptying the "Trashcan" is normally supported by
646 graphical file managers such as nautilus, but you can also see the
647 trash with the command: gio list trash://.</para>
649 <title>Options</title>
652 <term><option>-f</option>, <option>--force</option></term>
653 <listitem><para>Ignore non-existent and non-deletable files.</para></listitem>
656 <term><option>--empty</option></term>
657 <listitem><para>Empty the trash.</para></listitem>
666 <command>tree</command>
667 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
668 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
671 <para>Lists the contents of the given locations recursively, in a
672 tree-like format. If no location is given, it defaults to the current
674 <para>The tree command is similar to the traditional tree utility.</para>
676 <title>Options</title>
679 <term><option>-h</option>, <option>--hidden</option></term>
680 <listitem><para>Show hidden files.</para></listitem>
683 <term><option>-l</option>, <option>--follow-symlinks</option></term>
684 <listitem><para>Follow symbolic links.</para></listitem>
694 <title>Exit status</title>
695 <para>On success 0 is returned, a non-zero failure code otherwise.</para>
699 <title>See Also</title>
702 <refentrytitle>cat</refentrytitle>
703 <manvolnum>1</manvolnum>
706 <refentrytitle>cp</refentrytitle>
707 <manvolnum>1</manvolnum>
710 <refentrytitle>ls</refentrytitle>
711 <manvolnum>1</manvolnum>
714 <refentrytitle>mkdir</refentrytitle>
715 <manvolnum>1</manvolnum>
718 <refentrytitle>mv</refentrytitle>
719 <manvolnum>1</manvolnum>
722 <refentrytitle>rm</refentrytitle>
723 <manvolnum>1</manvolnum>
726 <refentrytitle>tree</refentrytitle>
727 <manvolnum>1</manvolnum>