1<?xml version="1.0"?> 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> 3<refentry id="gio"> 4 <refentryinfo> 5 <title>gio</title> 6 <productname>GIO</productname> 7 <authorgroup> 8 <author> 9 <contrib>Developer</contrib> 10 <firstname>Matthias</firstname> 11 <surname>Clasen</surname> 12 <email>mclasen@redhat.com</email> 13 </author> 14 </authorgroup> 15 </refentryinfo> 16 17 <refmeta> 18 <refentrytitle>gio</refentrytitle> 19 <manvolnum>1</manvolnum> 20 <refmiscinfo class="manual">User Commands</refmiscinfo> 21 </refmeta> 22 23 <refnamediv> 24 <refname>gio</refname> 25 <refpurpose>GIO commandline tool</refpurpose> 26 </refnamediv> 27 28 <refsynopsisdiv> 29 <cmdsynopsis> 30 <command>gio</command> 31 <arg choice="plain">help</arg> 32 <arg choice="opt"><replaceable>COMMAND</replaceable></arg> 33 </cmdsynopsis> 34 <cmdsynopsis> 35 <command>gio</command> 36 <arg choice="plain">version</arg> 37 </cmdsynopsis> 38 <cmdsynopsis> 39 <command>gio</command> 40 <arg choice="plain">cat</arg> 41 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 42 </cmdsynopsis> 43 <cmdsynopsis> 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> 49 </cmdsynopsis> 50 <cmdsynopsis> 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> 55 </cmdsynopsis> 56 <cmdsynopsis> 57 <command>gio</command> 58 <arg choice="plain">launch</arg> 59 <arg choice="plain"><replaceable>DESKTOP-FILE</replaceable></arg> 60 <arg choice="opt" rep="repeat"><replaceable>FILE-ARG</replaceable></arg> 61 </cmdsynopsis> 62 <cmdsynopsis> 63 <command>gio</command> 64 <arg choice="plain">list</arg> 65 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 66 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 67 </cmdsynopsis> 68 <cmdsynopsis> 69 <command>gio</command> 70 <arg choice="plain">mime</arg> 71 <arg choice="plain"><replaceable>MIMETYPE</replaceable></arg> 72 <arg choice="opt"><replaceable>HANDLER</replaceable></arg> 73 </cmdsynopsis> 74 <cmdsynopsis> 75 <command>gio</command> 76 <arg choice="plain">mkdir</arg> 77 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 78 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 79 </cmdsynopsis> 80 <cmdsynopsis> 81 <command>gio</command> 82 <arg choice="plain">monitor</arg> 83 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 84 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 85 </cmdsynopsis> 86 <cmdsynopsis> 87 <command>gio</command> 88 <arg choice="plain">mount</arg> 89 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 90 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 91 </cmdsynopsis> 92 <cmdsynopsis> 93 <command>gio</command> 94 <arg choice="plain">move</arg> 95 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 96 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg> 97 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg> 98 </cmdsynopsis> 99 <cmdsynopsis> 100 <command>gio</command> 101 <arg choice="plain">open</arg> 102 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 103 </cmdsynopsis> 104 <cmdsynopsis> 105 <command>gio</command> 106 <arg choice="plain">rename</arg> 107 <arg choice="plain"><replaceable>LOCATION</replaceable></arg> 108 <arg choice="plain"><replaceable>NAME</replaceable></arg> 109 </cmdsynopsis> 110 <cmdsynopsis> 111 <command>gio</command> 112 <arg choice="plain">remove</arg> 113 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 114 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 115 </cmdsynopsis> 116 <cmdsynopsis> 117 <command>gio</command> 118 <arg choice="plain">save</arg> 119 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 120 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg> 121 </cmdsynopsis> 122 <cmdsynopsis> 123 <command>gio</command> 124 <arg choice="plain">set</arg> 125 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 126 <arg choice="plain"><replaceable>LOCATION</replaceable></arg> 127 <arg choice="plain"><replaceable>ATTRIBUTE</replaceable></arg> 128 <arg choice="plain" rep="repeat"><replaceable>VALUE</replaceable></arg> 129 </cmdsynopsis> 130 <cmdsynopsis> 131 <command>gio</command> 132 <arg choice="plain">trash</arg> 133 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 134 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 135 </cmdsynopsis> 136 <cmdsynopsis> 137 <command>gio</command> 138 <arg choice="plain">tree</arg> 139 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 140 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 141 </cmdsynopsis> 142 </refsynopsisdiv> 143 144 <refsect1> 145 <title>Description</title> 146 <para><command>gio</command> is a utility that makes many of the GIO 147 features available from the commandline. In doing so, it provides 148 commands that are similar to traditional utilities, but let you 149 use GIO locations instead of local files: for example you can use 150 something like <filename>smb://server/resource/file.txt</filename> 151 as a location.</para> 152 <para>Plain filenames which contain a colon will be interpreted as URIs 153 with an unknown protocol. To avoid this, prefix them with a path such as 154 <filename>./</filename>, or with the <literal>file:</literal> protocol.</para> 155 </refsect1> 156 157 <refsect1> 158 <title>Commands</title> 159 160 <variablelist> 161 <varlistentry> 162 <term> 163 <command>help</command> 164 <arg choice="opt"><replaceable>COMMAND</replaceable></arg> 165 </term> 166 <listitem> 167 <para>Displays a short synopsis of the available commands or provides 168 detailed help on a specific command.</para> 169 </listitem> 170 </varlistentry> 171 172 <varlistentry> 173 <term> 174 <command>version</command> 175 </term> 176 <listitem> 177 <para>Prints the GLib version to which <command>gio</command> 178 belongs.</para> 179 </listitem> 180 </varlistentry> 181 182 <varlistentry> 183 <term> 184 <command>cat</command> 185 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 186 </term> 187 <listitem> 188 <para>Concatenates the given files and prints them to the standard 189 output.</para> 190 <para>The <command>cat</command> command works just like the traditional <command>cat</command> utility.</para> 191 <para>Note: just pipe through <command>cat</command> if you need its formatting options 192 like <option>-n</option>, <option>-T</option> or other.</para> 193 </listitem> 194 </varlistentry> 195 196 <varlistentry> 197 <term> 198 <command>copy</command> 199 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 200 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg> 201 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg> 202 </term> 203 <listitem> 204 <para>Copies one or more files from <replaceable>SOURCE</replaceable> 205 to <replaceable>DESTINATION</replaceable>. If more than one source 206 is specified, the destination must be a directory.</para> 207 <para>The <command>copy</command> command is similar to the traditional <command>cp</command> utility.</para> 208 <refsect3> 209 <title>Options</title> 210 <variablelist> 211 <varlistentry> 212 <term><option>-T</option>, <option>--no-target-directory</option></term> 213 <listitem><para>Don’t copy into <replaceable>DESTINATION</replaceable> even if it is a directory.</para></listitem> 214 </varlistentry> 215 <varlistentry> 216 <term><option>-p</option>, <option>--progress</option></term> 217 <listitem><para>Show progress.</para></listitem> 218 </varlistentry> 219 <varlistentry> 220 <term><option>-i</option>, <option>--interactive</option></term> 221 <listitem><para>Prompt for confirmation before overwriting files.</para></listitem> 222 </varlistentry> 223 <varlistentry> 224 <term><option>--preserve</option></term> 225 <listitem><para>Preserve all attributes of copied files.</para></listitem> 226 </varlistentry> 227 <varlistentry> 228 <term><option>-b</option>, <option>--backup</option></term> 229 <listitem><para>Create backups of existing destination files.</para></listitem> 230 </varlistentry> 231 <varlistentry> 232 <term><option>-P</option>, <option>--no-dereference</option></term> 233 <listitem><para>Never follow symbolic links.</para></listitem> 234 </varlistentry> 235 <varlistentry> 236 <term><option>--default-permissions</option></term> 237 <listitem><para>Use the default permissions of the current process for the destination file, rather than copying the permissions of the source file.</para></listitem> 238 </varlistentry> 239 </variablelist> 240 </refsect3> 241 </listitem> 242 </varlistentry> 243 <varlistentry> 244 <term> 245 <command>info</command> 246 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 247 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 248 </term> 249 <listitem> 250 <para>Shows information about the given locations.</para> 251 <para>The <command>info</command> command is similar to the traditional <command>ls</command> utility.</para> 252 <refsect3> 253 <title>Options</title> 254 <variablelist> 255 <varlistentry> 256 <term><option>-w</option>, <option>--query-writable</option></term> 257 <listitem><para>List writable attributes.</para></listitem> 258 </varlistentry> 259 <varlistentry> 260 <term><option>-f</option>, <option>--filesystem</option></term> 261 <listitem><para>Show information about the filesystem that the given 262 locations reside on.</para></listitem> 263 </varlistentry> 264 <varlistentry> 265 <term><option>-a</option> <option>--attributes=<replaceable>ATTRIBUTES</replaceable></option></term> 266 <listitem><para>The attributes to get.</para> 267 <para>Attributes can be specified with their GIO name, e.g. 268 <literal>standard::icon</literal>, or just by namespace, e.g. <literal>unix</literal>, or by <literal>*</literal>, 269 which matches all attributes. Several attributes or groups 270 of attributes can be specified, separated by comma.</para> 271 <para>By default, all attributes are listed.</para></listitem> 272 </varlistentry> 273 <varlistentry> 274 <term><option>-n</option>, <option>--nofollow-symlinks</option></term> 275 <listitem><para>Don’t follow symbolic links.</para></listitem> 276 </varlistentry> 277 </variablelist> 278 </refsect3> 279 </listitem> 280 </varlistentry> 281 282 <varlistentry> 283 <term> 284 <command>launch</command> 285 <arg choice="plain"><replaceable>DESKTOP-FILE</replaceable></arg> 286 <arg choice="opt" rep="repeat"><replaceable>FILE-ARG</replaceable></arg> 287 </term> 288 <listitem> 289 <para>Launch a desktop file from any location given.</para> 290 <para>The <command>launch</command> command extends the behavior of the <command>open</command> command by allowing 291 any desktop file to be launched, not only those registered as file handlers.</para> 292 </listitem> 293 </varlistentry> 294 295 <varlistentry> 296 <term> 297 <command>list</command> 298 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 299 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 300 </term> 301 <listitem> 302 <para>Lists the contents of the given locations. If no location is 303 given, the contents of the current directory are shown.</para> 304 <para>The <command>list</command> command is similar to the traditional <command>ls</command> utility.</para> 305 <refsect3> 306 <title>Options</title> 307 <variablelist> 308 <varlistentry> 309 <term><option>-a</option> <option>--attributes=<replaceable>ATTRIBUTES</replaceable></option></term> 310 <listitem><para>The attributes to get.</para> 311 <para>Attributes can be specified with their GIO name, e.g. 312 <literal>standard::icon</literal>, or just by namespace, e.g. <literal>unix</literal>, or by <literal>*</literal>, 313 which matches all attributes. Several attributes or groups 314 of attributes can be specified, separated by comma.</para> 315 <para>By default, all attributes are listed.</para></listitem> 316 </varlistentry> 317 <varlistentry> 318 <term><option>-h</option>, <option>--hidden</option></term> 319 <listitem><para>Show hidden files.</para></listitem> 320 </varlistentry> 321 <varlistentry> 322 <term><option>-l</option>, <option>--long</option></term> 323 <listitem><para>Use a long listing format.</para></listitem> 324 </varlistentry> 325 <varlistentry> 326 <term><option>-n</option>, <option>--nofollow-symlinks</option></term> 327 <listitem><para>Don’t follow symbolic links.</para></listitem> 328 </varlistentry> 329 <varlistentry> 330 <term><option>-d</option>, <option>--print-display-names</option></term> 331 <listitem><para>Print display names.</para></listitem> 332 </varlistentry> 333 <varlistentry> 334 <term><option>-u</option>, <option>--print-uris</option></term> 335 <listitem><para>Print full URIs.</para></listitem> 336 </varlistentry> 337 </variablelist> 338 </refsect3> 339 </listitem> 340 </varlistentry> 341 342 <varlistentry> 343 <term> 344 <command>mime</command> 345 <arg choice="plain"><replaceable>MIMETYPE</replaceable></arg> 346 <arg choice="opt"><replaceable>HANDLER</replaceable></arg> 347 </term> 348 <listitem> 349 <para>If no handler is given, the <command>mime</command> command lists the 350 registered and recommended applications for the mimetype. 351 If a handler is given, it is set as the default handler for 352 the mimetype.</para> 353 <para>Handlers must be specified by their desktop file name, 354 including the extension. Example: <literal>org.gnome.gedit.desktop</literal>.</para> 355 </listitem> 356 </varlistentry> 357 358 <varlistentry> 359 <term> 360 <command>mkdir</command> 361 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 362 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 363 </term> 364 <listitem> 365 <para>Creates directories.</para> 366 <para>The <command>mkdir</command> command is similar to the traditional <command>mkdir</command> utility.</para> 367 <refsect3> 368 <title>Options</title> 369 <variablelist> 370 <varlistentry> 371 <term><option>-p</option>, <option>--parent</option></term> 372 <listitem><para>Create parent directories when necessary.</para></listitem> 373 </varlistentry> 374 </variablelist> 375 </refsect3> 376 </listitem> 377 </varlistentry> 378 379 <varlistentry> 380 <term> 381 <command>monitor</command> 382 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 383 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 384 </term> 385 <listitem> 386 <para>Monitors files or directories for changes, such as creation 387 deletion, content and attribute changes, and mount and unmount 388 operations affecting the monitored locations.</para> 389 <para>The <command>monitor</command> command uses the GIO file monitoring APIs to do 390 its job. GIO has different implementations for different platforms. 391 The most common implementation on Linux uses inotify.</para> 392 <refsect3> 393 <title>Options</title> 394 <variablelist> 395 <varlistentry> 396 <term><option>-d</option>, <option>--dir=<replaceable>LOCATION</replaceable></option></term> 397 <listitem><para>Monitor the given location as a directory. Normally, 398 the file type is used to determine whether to monitor a file or directory.</para></listitem> 399 </varlistentry> 400 <varlistentry> 401 <term><option>-f</option>, <option>--file=<replaceable>LOCATION</replaceable></option></term> 402 <listitem><para>Monitor the given location as a file. Normally, 403 the file type is used to determine whether to monitor a file or directory.</para></listitem> 404 </varlistentry> 405 <varlistentry> 406 <term><option>-D</option>, <option>--direct=<replaceable>LOCATION</replaceable></option></term> 407 <listitem><para>Monitor the file directly. This allows changes made via hardlinks to be captured.</para></listitem> 408 </varlistentry> 409 <varlistentry> 410 <term><option>-s</option>, <option>--silent=<replaceable>LOCATION</replaceable></option></term> 411 <listitem><para>Monitor the file directly, but don’t report changes.</para></listitem> 412 </varlistentry> 413 <varlistentry> 414 <term><option>-n</option>, <option>--no-moves</option></term> 415 <listitem><para>Report moves and renames as simple deleted/created events.</para></listitem> 416 </varlistentry> 417 <varlistentry> 418 <term><option>-m</option>, <option>--mounts</option></term> 419 <listitem><para>Watch for mount events.</para></listitem> 420 </varlistentry> 421 </variablelist> 422 </refsect3> 423 </listitem> 424 </varlistentry> 425 426 <varlistentry> 427 <term> 428 <command>mount</command> 429 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 430 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 431 </term> 432 <listitem> 433 <para>Provides commandline access to various aspects of GIO’s mounting 434 functionality.</para> 435 <para>Mounting refers to the traditional concept of arranging multiple 436 file systems and devices in a single tree, rooted at <filename>/</filename>. Classical 437 mounting happens in the kernel and is controlled by the mount utility. 438 GIO expands this concept by introducing mount daemons that can make 439 file systems available to GIO applications without kernel 440 involvement.</para> 441 <para>GIO mounts can require authentication, and the <command>mount</command> command 442 may ask for user IDs, passwords, and so on, when required.</para> 443 <refsect3> 444 <title>Options</title> 445 <variablelist> 446 <varlistentry> 447 <term><option>-m</option>, <option>--mountable</option></term> 448 <listitem><para>Mount as mountable.</para></listitem> 449 </varlistentry> 450 <varlistentry> 451 <term><option>-d</option>, <option>--device=<replaceable>ID</replaceable></option></term> 452 <listitem><para>Mount volume with device file, or other identifier.</para></listitem> 453 </varlistentry> 454 <varlistentry> 455 <term><option>-u</option>, <option>--unmount</option></term> 456 <listitem><para>Unmount the location.</para></listitem> 457 </varlistentry> 458 <varlistentry> 459 <term><option>-e</option>, <option>--eject</option></term> 460 <listitem><para>Eject the location.</para></listitem> 461 </varlistentry> 462 <varlistentry> 463 <term><option>-t</option>, <option>--stop=<replaceable>DEVICE</replaceable></option></term> 464 <listitem><para>Stop drive with device file.</para></listitem> 465 </varlistentry> 466 <varlistentry> 467 <term><option>-s</option>, <option>--unmount-scheme=<replaceable>SCHEME</replaceable></option></term> 468 <listitem><para>Unmount all mounts with the given scheme.</para></listitem> 469 </varlistentry> 470 <varlistentry> 471 <term><option>-f</option>, <option>--force</option></term> 472 <listitem><para>Ignore outstanding file operations when unmounting or ejecting.</para></listitem> 473 </varlistentry> 474 <varlistentry> 475 <term><option>-a</option>, <option>--anonymous</option></term> 476 <listitem><para>Use an anonymous user when authenticating.</para></listitem> 477 </varlistentry> 478 <varlistentry> 479 <term><option>-l</option>, <option>--list</option></term> 480 <listitem><para>List all GIO mounts.</para></listitem> 481 </varlistentry> 482 <varlistentry> 483 <term><option>-o</option>, <option>--monitor</option></term> 484 <listitem><para>Monitor mount-related events.</para> 485 </listitem> 486 </varlistentry> 487 <varlistentry> 488 <term><option>-i</option>, <option>--detail</option></term> 489 <listitem><para>Show extra information.</para> 490 </listitem> 491 </varlistentry> 492 <varlistentry> 493 <term><option>--tcrypt-pim</option></term> 494 <listitem><para>The numeric PIM when unlocking a VeraCrypt volume.</para> 495 </listitem> 496 </varlistentry> 497 <varlistentry> 498 <term><option>--tcrypt-hidden</option></term> 499 <listitem><para>Mount a TCRYPT hidden volume.</para> 500 </listitem> 501 </varlistentry> 502 <varlistentry> 503 <term><option>--tcrypt-system</option></term> 504 <listitem><para>Mount a TCRYPT system volume.</para> 505 </listitem> 506 </varlistentry> 507 </variablelist> 508 </refsect3> 509 </listitem> 510 </varlistentry> 511 512 <varlistentry> 513 <term> 514 <command>move</command> 515 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 516 <arg choice="plain" rep="repeat"><replaceable>SOURCE</replaceable></arg> 517 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg> 518 </term> 519 <listitem> 520 <para>Moves one or more files from <replaceable>SOURCE</replaceable> 521 to <replaceable>DESTINATION</replaceable>. If more than one source 522 is specified, the destination must be a directory.</para> 523 <para>The <command>move</command> command is similar to the traditional <command>mv</command> utility.</para> 524 <refsect3> 525 <title>Options</title> 526 <variablelist> 527 <varlistentry> 528 <term><option>-T</option>, <option>--no-target-directory</option></term> 529 <listitem><para>Don’t copy into <replaceable>DESTINATION</replaceable> even if it is a directory.</para></listitem> 530 </varlistentry> 531 <varlistentry> 532 <term><option>-p</option>, <option>--progress</option></term> 533 <listitem><para>Show progress.</para></listitem> 534 </varlistentry> 535 <varlistentry> 536 <term><option>-i</option>, <option>--interactive</option></term> 537 <listitem><para>Prompt for confirmation before overwriting files.</para></listitem> 538 </varlistentry> 539 <varlistentry> 540 <term><option>-b</option>, <option>--backup</option></term> 541 <listitem><para>Create backups of existing destination files.</para></listitem> 542 </varlistentry> 543 <varlistentry> 544 <term><option>-C</option>, <option>--no-copy-fallback</option></term> 545 <listitem><para>Don’t use copy and delete fallback.</para></listitem> 546 </varlistentry> 547 </variablelist> 548 </refsect3> 549 </listitem> 550 </varlistentry> 551 552 <varlistentry> 553 <term> 554 <command>open</command> 555 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 556 </term> 557 <listitem> 558 <para>Opens files with the default application that is registered 559 to handle files of this type.</para> 560 <para>GIO obtains this information from the shared-mime-info 561 database, with per-user overrides stored in 562 <filename><envar>$XDG_DATA_HOME</envar>/applications/mimeapps.list</filename>.</para> 563 <para>The <command>mime</command> command can be used to change the default handler for 564 a mimetype.</para> 565 <para>Environment variables will not be set on the application, as it 566 may be an existing process which is activated to handle the new file.</para> 567 </listitem> 568 </varlistentry> 569 570 <varlistentry> 571 <term> 572 <command>rename</command> 573 <arg choice="plain"><replaceable>LOCATION</replaceable></arg> 574 <arg choice="plain"><replaceable>NAME</replaceable></arg> 575 </term> 576 <listitem> 577 <para>Renames a file.</para> 578 <para>The <command>rename</command> command is similar to the traditional <command>rename</command> utility.</para> 579 </listitem> 580 </varlistentry> 581 582 <varlistentry> 583 <term> 584 <command>remove</command> 585 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 586 <arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg> 587 </term> 588 <listitem> 589 <para>Deletes each given file.</para> 590 <para>This command removes files irreversibly. If you want a reversible 591 way to remove files, see the <command>trash</command> command.</para> 592 <para>Note that not all URI schemes that are supported by GIO may 593 allow deletion of files.</para> 594 <para>The <command>remove</command> command is similar to the traditional <command>rm</command> utility.</para> 595 <refsect3> 596 <title>Options</title> 597 <variablelist> 598 <varlistentry> 599 <term><option>-f</option>, <option>--force</option></term> 600 <listitem><para>Ignore non-existent and non-deletable files.</para></listitem> 601 </varlistentry> 602 </variablelist> 603 </refsect3> 604 </listitem> 605 </varlistentry> 606 607 <varlistentry> 608 <term> 609 <command>save</command> 610 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 611 <arg choice="plain"><replaceable>DESTINATION</replaceable></arg> 612 </term> 613 <listitem> 614 <para>Reads from standard input and saves the data to the given 615 location.</para> 616 <para>This is similar to just redirecting output to a file using 617 traditional shell syntax, but the <command>save</command> command allows saving to 618 location that GIO can write to.</para> 619 <refsect3> 620 <title>Options</title> 621 <variablelist> 622 <varlistentry> 623 <term><option>-b</option>, <option>--backup</option></term> 624 <listitem><para>Back up existing destination files.</para></listitem> 625 </varlistentry> 626 <varlistentry> 627 <term><option>-c</option>, <option>--create</option></term> 628 <listitem><para>Only create the destination if it doesn’t exist yet.</para></listitem> 629 </varlistentry> 630 <varlistentry> 631 <term><option>-a</option>, <option>--append</option></term> 632 <listitem><para>Append to the end of the file.</para></listitem> 633 </varlistentry> 634 <varlistentry> 635 <term><option>-p</option>, <option>--private</option></term> 636 <listitem><para>When creating, restrict access to the current user.</para></listitem> 637 </varlistentry> 638 <varlistentry> 639 <term><option>-u</option>, <option>--unlink</option></term> 640 <listitem><para>When replacing, replace as if the destination did not exist.</para></listitem> 641 </varlistentry> 642 <varlistentry> 643 <term><option>-v</option>, <option>--print-etag</option></term> 644 <listitem><para>Print the new ETag in the end.</para></listitem> 645 </varlistentry> 646 <varlistentry> 647 <term><option>-e</option>, <option>--etag=<replaceable>ETAG</replaceable></option></term> 648 <listitem><para>The ETag of the file that is overwritten.</para></listitem> 649 </varlistentry> 650 </variablelist> 651 </refsect3> 652 </listitem> 653 </varlistentry> 654 655 <varlistentry> 656 <term> 657 <command>set</command> 658 <arg choice="plain"><replaceable>LOCATION</replaceable></arg> 659 <arg choice="plain"><replaceable>ATTRIBUTE</replaceable></arg> 660 <arg choice="plain" rep="repeat"><replaceable>VALUE</replaceable></arg> 661 </term> 662 <listitem> 663 <para>Sets a file attribute on a file.</para> 664 <para>File attributes can be specified with their GIO name, e.g 665 <literal>standard::icon</literal>. Note that not all GIO file attributes are writable. 666 Use the <option>--query-writable</option> option of the <command>info</command> command to list 667 writable file attributes.</para> 668 <para>If the <replaceable>TYPE</replaceable> is unset, 669 <replaceable>VALUE</replaceable> does not have to be specified. 670 If the <replaceable>TYPE</replaceable> is <literal>stringv</literal>, multiple values can be given.</para> 671 <refsect3> 672 <title>Options</title> 673 <variablelist> 674 <varlistentry> 675 <term><option>-t</option>, <option>--type=<replaceable>TYPE</replaceable></option></term> 676 <listitem><para>Specifies the type of the attribute. Supported 677 types are <literal>string</literal>, <literal>stringv</literal>, 678 <literal>bytestring</literal>, <literal>boolean</literal>, 679 <literal>uint32</literal>, <literal>int32</literal>, 680 <literal>uint64</literal>, <literal>int64</literal> and <literal>unset</literal>.</para> 681 <para>If the type is not specified, <literal>string</literal> is assumed.</para> 682 </listitem> 683 </varlistentry> 684 <varlistentry> 685 <term><option>-n</option>, <option>--nofollow-symlinks</option></term> 686 <listitem><para>Don’t follow symbolic links.</para></listitem> 687 </varlistentry> 688 </variablelist> 689 </refsect3> 690 </listitem> 691 </varlistentry> 692 693 <varlistentry> 694 <term> 695 <command>trash</command> 696 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 697 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 698 </term> 699 <listitem> 700 <para>Sends files or directories to the ‘Trashcan’ or restore them from 701 ‘Trashcan’. This can be a different folder depending on where the file 702 is located, and not all file systems support this concept. In the common 703 case that the file lives inside a user’s home directory, the trash folder is 704 <filename><envar>$XDG_DATA_HOME</envar>/Trash</filename>.</para> 705 <para>Note that moving files to the trash does not free up space on 706 the file system until the ‘Trashcan’ is emptied. If you are interested 707 in deleting a file irreversibly, see the <command>remove</command> command.</para> 708 <para>Inspecting and emptying the ‘Trashcan’ is normally supported by 709 graphical file managers such as Nautilus, but you can also see the 710 trash with the command: <command>gio trash --list</command> or 711 <command>gio list trash://</command>.</para> 712 <refsect3> 713 <title>Options</title> 714 <variablelist> 715 <varlistentry> 716 <term><option>-f</option>, <option>--force</option></term> 717 <listitem><para>Ignore non-existent and non-deletable files.</para></listitem> 718 </varlistentry> 719 <varlistentry> 720 <term><option>--empty</option></term> 721 <listitem><para>Empty the trash.</para></listitem> 722 </varlistentry> 723 <varlistentry> 724 <term><option>--list</option></term> 725 <listitem><para>List files in the trash with their original locations</para></listitem> 726 </varlistentry> 727 <varlistentry> 728 <term><option>--restore</option></term> 729 <listitem><para>Restore a file from trash to its original location. A URI beginning 730 with <literal>trash://</literal> is expected here. If the original 731 directory doesn't exist, it will be recreated.</para></listitem> 732 </varlistentry> 733 </variablelist> 734 </refsect3> 735 </listitem> 736 </varlistentry> 737 738 <varlistentry> 739 <term> 740 <command>tree</command> 741 <arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg> 742 <arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg> 743 </term> 744 <listitem> 745 <para>Lists the contents of the given locations recursively, in a 746 tree-like format. If no location is given, it defaults to the current 747 directory.</para> 748 <para>The <command>tree</command> command is similar to the traditional <command>tree</command> utility.</para> 749 <refsect3> 750 <title>Options</title> 751 <variablelist> 752 <varlistentry> 753 <term><option>-h</option>, <option>--hidden</option></term> 754 <listitem><para>Show hidden files.</para></listitem> 755 </varlistentry> 756 <varlistentry> 757 <term><option>-l</option>, <option>--follow-symlinks</option></term> 758 <listitem><para>Follow symbolic links.</para></listitem> 759 </varlistentry> 760 </variablelist> 761 </refsect3> 762 </listitem> 763 </varlistentry> 764 </variablelist> 765 </refsect1> 766 767 <refsect1> 768 <title>Exit status</title> 769 <para>On success 0 is returned, a non-zero failure code otherwise.</para> 770 </refsect1> 771 772 <refsect1> 773 <title>See Also</title> 774 <para> 775 <citerefentry> 776 <refentrytitle>cat</refentrytitle> 777 <manvolnum>1</manvolnum> 778 </citerefentry>, 779 <citerefentry> 780 <refentrytitle>cp</refentrytitle> 781 <manvolnum>1</manvolnum> 782 </citerefentry>, 783 <citerefentry> 784 <refentrytitle>ls</refentrytitle> 785 <manvolnum>1</manvolnum> 786 </citerefentry>, 787 <citerefentry> 788 <refentrytitle>mkdir</refentrytitle> 789 <manvolnum>1</manvolnum> 790 </citerefentry>, 791 <citerefentry> 792 <refentrytitle>mv</refentrytitle> 793 <manvolnum>1</manvolnum> 794 </citerefentry>, 795 <citerefentry> 796 <refentrytitle>rm</refentrytitle> 797 <manvolnum>1</manvolnum> 798 </citerefentry>, 799 <citerefentry> 800 <refentrytitle>tree</refentrytitle> 801 <manvolnum>1</manvolnum> 802 </citerefentry>. 803 </para> 804 </refsect1> 805</refentry> 806