[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Request for a delete command which moves to the trash
From: |
Bob Proulx |
Subject: |
Re: Request for a delete command which moves to the trash |
Date: |
Sat, 17 Mar 2007 09:46:00 -0600 |
User-agent: |
Mutt/1.5.9i |
Shriramana Sharma wrote:
> To my knowledge, the rm command totally unlinks files. There is no
> command which is used to delete a file that only pushes files to the
> trash like in KDE (and GNOME?).
>
> Can we please have a deletion command that moves files to the trash can?
> Otherwise, it becomes impossible to recover files deleted accidentally
> from a terminal.
This can easily be accomplished by the user if the user desires it by
using the 'mv' command instead of the 'rm' command.
As an alias for the user's shell.
alias del='mv --backup=numbered --target-directory=/path/to/trash'
As a script.
#!/bin/sh
exec mv --backup=numbered --target-directory=/path/to/trash "$@"
Bob