Andrew Mercer
on this page

    trash-cli moves files to the same Trash your desktop uses (~/.local/share/Trash/) instead of removing them, so a slip is recoverable.

    sudo dnf install trash-cli             # or apt-get install trash-cli
    
    trash file.txt                         # same as: mv file.txt ~/.local/share/Trash/files/ (plus metadata)
    trash-list                             # what is in the trash
    trash-restore                          # interactively restore an item
    trash-empty 30                         # delete items trashed more than 30 days ago
    trash-empty                            # empty it now
    

    The trash also records the original path (~/.local/share/Trash/info/), which a bare mv into the folder does not, so trash-restore needs the tool, not a manual move. A common habit is alias rm='echo use trash' to break the muscle memory. Note that trashing does not securely erase anything.