cmd/gio/trash

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< cmd‎ | gio
Jump to navigation Jump to search
  • Command: gio trash [OPTION...] [LOCATION...]
  • Action: Sends files or directories to the ‘Trashcan’ or restore them from ‘Trashcan’.

About

The 'Trashcan' 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 remove command.

Inspecting and emptying the ‘Trashcan’ is normally supported by graphical file managers such as Nautilus, but you can also see the trash with these commands:

  • gio trash --list
  • gio list trash://

Options

short long description
-f --force Ignore non-existent and non-deletable files.
--empty Empty the trash.
--list List files in the trash with their original locations
--restore Restore 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.