← 返回命令列表

Linux command

trash-empty 命令

文本

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

常用示例

Empty all trashed files

trash-empty

Empty files trashed more than N days ago

trash-empty [days]

Skip the confirmation prompt

trash-empty -f

Empty trash on a specific volume

trash-empty --trash-dir=[/path/to/.Trash]

说明

trash-empty is part of the trash-cli suite and permanently removes files from the trash. Without arguments it empties all trashed files. When given a number of days, only files trashed earlier than that threshold are removed, allowing periodic clean-up via cron while keeping recent items recoverable. It operates on the standard FreeDesktop.org trash locations, including per-user and per-volume trash directories.

参数

-f
Don't ask for confirmation before deleting.
-i, --interactive
Prompt before deleting each file.
--trash-dir _DIR_
Empty a specific trash directory instead of the default per-user/per-volume locations.
-v, --verbose
List files as they are deleted.
--dry-run
Show what would be deleted without actually removing anything.
-h, --help
Display help information.
--version
Display version information.

FAQ

What is the trash-empty command used for?

trash-empty is part of the trash-cli suite and permanently removes files from the trash. Without arguments it empties all trashed files. When given a number of days, only files trashed earlier than that threshold are removed, allowing periodic clean-up via cron while keeping recent items recoverable. It operates on the standard FreeDesktop.org trash locations, including per-user and per-volume trash directories.

How do I run a basic trash-empty example?

Run `trash-empty` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f do in trash-empty?

Don't ask for confirmation before deleting.