Difference between revisions of "cmd/gio"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< cmd
Jump to navigation Jump to search
(oops)
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
! subcommand || argument(s) || purpose
 
! subcommand || argument(s) || purpose
 
|-
 
|-
| '''{{l/sub|open}}''' || [{{arg|file}} or {{arg|URL}}] || opens files and URLs using the default applications as specified by the user's desktop environment
+
| '''{{l/sub|help}}''' || [{{arg|COMMAND}}] || Displays a short synopsis of the available commands or provides detailed help on a specific command.
|-
 
| '''{{l/sub|help}}''' || [COMMAND] || Displays a short synopsis of the available commands or provides detailed help on a specific command.
 
 
|-
 
|-
 
| '''{{l/sub|version}}''' || || Prints the GLib version to which gio belongs.
 
| '''{{l/sub|version}}''' || || Prints the GLib version to which gio belongs.
 
|-
 
|-
| '''{{l/sub|cat}}''' || LOCATION...  
+
| '''{{l/sub|cat}}''' || {{arg|LOCATION}}...  
 
| <poem>
 
| <poem>
 
Concatenates the given files and prints them to the standard output.
 
Concatenates the given files and prints them to the standard output.
Line 19: Line 17:
 
</poem>
 
</poem>
 
|-
 
|-
| '''{{l/sub|copy}}''' || [OPTION...] SOURCE... DESTINATION || Copies one or more files from SOURCE to DESTINATION; similar to {{l/cmd|cp}}.
+
| '''{{l/sub|copy}}''' || [{{arg|OPTION}}...] {{arg|SOURCE}}... {{arg|DESTINATION}} || Copies one or more files from {{arg|SOURCE}} to {{arg|DESTINATION}}; similar to {{l/cmd|cp}}.
 
|-
 
|-
| '''{{l/sub|info}}''' || [OPTION...] LOCATION... || Shows information about the given locations; similar to {{l/cmd|ls}}.
+
| '''{{l/sub|info}}''' || [{{arg|OPTION}}...] {{arg|LOCATION}}... || Shows information about the given locations; similar to {{l/cmd|ls}}.
 
|-
 
|-
| '''{{l/sub|launch}}''' || DESKTOP-FILE [FILE-ARG...]
+
| '''{{l/sub|launch}}''' || {{arg|DESKTOP-FILE}} [{{arg|FILE-ARG}}...]
 
| Launch a desktop file from any location given.
 
| 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.
 
* 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.
 
|-
 
|-
| '''{{l/sub|list}}''' || [OPTION...] [LOCATION...] || Lists the contents of the given locations; similar to {{l/cmd|ls}}.
+
| '''{{l/sub|list}}''' || [{{arg|OPTION}}...] [{{arg|LOCATION}}...] || Lists the contents of the given locations; similar to {{l/cmd|ls}}.
 
|-
 
|-
| '''{{l/sub|mime}}''' || [OPTION...] LOCATION...
+
| '''{{l/sub|mime}}''' || {{arg|MIMETYPE}} [{{arg|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.
 
* 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: <code>org.gnome.gedit.desktop</code>.
 
* Handlers must be specified by their desktop file name, including the extension. Example: <code>org.gnome.gedit.desktop</code>.
 
|-
 
|-
| '''{{l/sub|mkdir}}''' || MIMETYPE [HANDLER] || Creates directories; similar to {{l/cmd|mkdir}}.
+
| '''{{l/sub|mkdir}}''' || [{{arg|OPTION}}...] {{arg|LOCATION}}... || Creates directories; similar to {{l/cmd|mkdir}}.
 
* Options:
 
* Options:
 
** -p, --parent
 
** -p, --parent
 
**: Create parent directories when necessary.
 
**: Create parent directories when necessary.
 
|-
 
|-
| '''{{l/sub|monitor}}''' || [OPTION...] [LOCATION...] || Monitors files or directories for changes
+
| '''{{l/sub|monitor}}''' || [{{arg|OPTION}}...] [{{arg|LOCATION}}...] || Monitors files or directories for changes
 
|-
 
|-
| '''{{l/sub|mount}}''' || [OPTION...] [LOCATION...] || Provides commandline access to various aspects of GIO’s mounting functionality.
+
| '''{{l/sub|mount}}''' || [{{arg|OPTION}}...] [{{arg|LOCATION}}...] || Provides commandline access to various aspects of GIO’s mounting functionality.
 
|-
 
|-
| '''{{l/sub|move}}''' || [OPTION...] SOURCE... DESTINATION || Moves one or more files from SOURCE to DESTINATION; similar to {{l/cmd|mv}}.
+
| '''{{l/sub|move}}''' || [{{arg|OPTION}}...] {{arg|SOURCE}}... {{arg|DESTINATION}} || Moves one or more files from SOURCE to DESTINATION; similar to {{l/cmd|mv}}.
 
|-
 
|-
| '''{{l/sub|open}}''' || {{arg|LOCATION}}... || Opens files with the default application that is registered to handle files of this type; related to [[xdg-open]].
+
| '''{{l/sub|open}}''' || [{{arg|file}} or {{arg|URL}}] || Opens files with the default application that is registered to handle files of this type; related to [[xdg-open]].
|
 
 
* GIO obtains this information from the shared-mime-info database, with per-user overrides stored in <code>$XDG_DATA_HOME/applications/mimeapps.list</code>.
 
* GIO obtains this information from the shared-mime-info database, with per-user overrides stored in <code>$XDG_DATA_HOME/applications/mimeapps.list</code>.
 
* The mime command can be used to change the default handler for a mimetype.
 
* The mime command can be used to change the default handler for a mimetype.

Latest revision as of 23:52, 2 January 2024

About

gio is a command line interface to the GIO subsystem.

Commands

subcommand argument(s) purpose
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 gio belongs.
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.

copy [<OPTION>...] <SOURCE>... <DESTINATION> Copies one or more files from <SOURCE> to <DESTINATION>; similar to cp.
info [<OPTION>...] <LOCATION>... Shows information about the given locations; similar to ls.
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.
list [<OPTION>...] [<LOCATION>...] Lists the contents of the given locations; similar to ls.
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.
mkdir [<OPTION>...] <LOCATION>... Creates directories; similar to mkdir.
  • Options:
    • -p, --parent
      Create parent directories when necessary.
monitor [<OPTION>...] [<LOCATION>...] Monitors files or directories for changes
mount [<OPTION>...] [<LOCATION>...] Provides commandline access to various aspects of GIO’s mounting functionality.
move [<OPTION>...] <SOURCE>... <DESTINATION> Moves one or more files from SOURCE to DESTINATION; similar to mv.
open [<file> or <URL>] Opens files with the default application that is registered to handle files of this type; related to xdg-open.
  • 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.
rename <LOCATION> <NAME> Renames a file; similar to rename.
remove [<OPTION>...] <LOCATION>... Deletes each given file; similar to rm.
  • 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.
  • Options:
    • -f, --force
      Ignore non-existent and non-deletable files.
save [<OPTION>...] <DESTINATION> Reads from standard input and saves the data to the given location.
set [<OPTION>...] <LOCATION> <ATTRIBUTE> <VALUE>... Sets a file attribute on a file.
trash [<OPTION>...] [<LOCATION>...] Sends files or directories to the ‘Trashcan’ or restore them from ‘Trashcan’.
tree [<OPTION>...] [<LOCATION>...] Lists the contents of the given locations recursively, in a tree-like format; similar to tree.
  • Options:
    • -h, --hidden
      Show hidden files.
    • -l, --follow-symlinks
      Follow symbolic links.