← 返回命令列表

Linux command

gio-trash 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Example

gio trash [path/to/file_or_directory1] [path/to/file_or_directory2] ...

List

gio trash --list

Restore

gio trash --restore trash:///[original/path/to/file]

Empty

gio trash --empty

说明

gio trash moves files to the trash bin instead of permanently deleting them, following the FreeDesktop.org Trash specification. Files are placed in ~/.local/share/Trash/ with metadata to enable restoration. This is the command-line equivalent of dragging files to the trash in GNOME Files (Nautilus). Trashed files can be viewed in the file manager's Trash location or listed with gio trash --list. Files from external drives are trashed to a .Trash-UID directory on that drive.

参数

--list
List items in the trash bin
--empty
Empty the trash bin permanently.
--restore
Restore a file from trash to its original location. A URI beginning with trash:// is expected. If the original directory doesn't exist, it will be recreated.
-f, --force
Ignore non-existent and non-deletable files.

FAQ

What is the gio-trash command used for?

gio trash moves files to the trash bin instead of permanently deleting them, following the FreeDesktop.org Trash specification. Files are placed in ~/.local/share/Trash/ with metadata to enable restoration. This is the command-line equivalent of dragging files to the trash in GNOME Files (Nautilus). Trashed files can be viewed in the file manager's Trash location or listed with gio trash --list. Files from external drives are trashed to a .Trash-UID directory on that drive.

How do I run a basic gio-trash example?

Run `gio trash [path/to/file_or_directory1] [path/to/file_or_directory2] ...` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --list do in gio-trash?

List items in the trash bin