Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Trash

Moves files to the system trash/recycle bin. This is a safer alternative to delete since files can be recovered.

Syntax

- trash

Options

This action has no options.

Examples

Clean old downloads

rules:
  - name: Trash Old Downloads
    locations: ~/Downloads
    filters:
      - date_modified:
          before:
            days_ago: 30
    actions:
      - trash

Trash old backups

rules:
  - name: Trash Old Backups
    locations: ~/Backup
    filters:
      - name: "*_backup_*"
      - date_modified:
          before:
            weeks_ago: 4
    actions:
      - trash

Trash temporary files

rules:
  - name: Clean Temp Files
    locations: ~/Projects
    subfolders: true
    filters:
      - extension: [tmp, temp, bak, swp]
    actions:
      - trash

Platform behavior

platformtrash location
macOS~/.Trash
Linux~/.local/share/Trash (freedesktop.org spec)
WindowsRecycle Bin

Comparison with delete

aspecttrashdelete
RecoverableYesNo
Disk spaceStill used until emptiedFreed immediately
SpeedSlightly slowerFaster
SafetySafeDangerous

Notes

  • Safer than delete for automated cleanup rules
  • Uses the system’s native trash mechanism
  • On Linux, follows the freedesktop.org trash specification