Overview
Based on the GIO library, gio can perform operations on local file systems as well as remote locations (FTP, SMB, etc.) and virtual file systems. In addition to common file management tasks, it provides features such as mount management and emptying the trash.
Key Features
- File copy/move/delete
- File information check
- Mount/unmount management
- Trash management
- URI schema support
Main Options
The gio command performs functions through various subcommands. Each subcommand can have its own options.
File Management
Information and Open
Mount Management
Gegenereerde opdracht:
Probeer de opdrachtcombinaties.
Uitleg:
`gio` Voer het commando uit.
Combineer deze opties en voer de opdracht virtueel uit met de AI.
Usage Examples
Here are some examples of using the gio command.
Check File Information
touch document.txt
gio info document.txt
rm document.txt
Displays detailed information about the 'document.txt' file in the current directory.
Move File to Trash
touch old_report.pdf
gio trash old_report.pdf
Moves the 'old_report.pdf' file to the trash.
List Directory Contents
gio list .
Lists the contents of the current directory.
Copy File
echo "Hello" > source.txt
gio copy source.txt destination.txt
rm source.txt destination.txt
Copies 'source.txt' to 'destination.txt'.
Open File with Default Application
gio open image.jpg
Opens 'image.jpg' with the system's default image viewer. (Requires an actual file to work)
Installation
gio is typically provided as part of the GLib development libraries or installed with desktop environments (e.g., GNOME). If it's not installed by default, you can install it using the following commands.
Debian/Ubuntu
sudo apt update && sudo apt install libglib2.0-bin
Fedora
sudo dnf install glib2
Arch Linux
sudo pacman -S glib2
Tips & Notes
gio is a powerful tool, but there are a few things to keep in mind.
Key Tips
- **Utilize URI Schemas**: gio supports various URI schemas such as `file://`, `ftp://`, `smb://`, allowing access to remote resources.
- **GNOME Environment Integration**: It is tightly integrated with file managers (Nautilus) in the GNOME desktop environment, enabling command-line operations similar to GUI actions.
- **Caution with Permanent Deletion**: The `gio rm` command permanently deletes files without sending them to the trash, so use it with caution.
- **Detailed Help**: For detailed information on each subcommand, you can use `gio help <subcommand>`.