(The command doesn't prompt for confirmation even though I did not use the -f option.)ĭeleting files this way is reversible, while being more convenient than redefining rm to be rm -i for safety and having to confirm each deletion, which still leaves you out of luck if you accidentally confirm a deletion you shouldn't have. ![]() I tested using gio trash FILENAME on the command line, and it works just like I'd selected the file in the file browser and clicked the DEL button: the file is moved to the desktop's Trash folder. f, -force Ignore nonexistent files, never prompt Commanding gio help trash outputs: Usage: Neither of those are found by default on Ubuntu 18.04, but the command gio is. The previous answers mention commands trash-cli and rmtrash. While those discussions have a point, I believe there’s still a niche for my request.) (As an aside, there have been endless discussions whether this approach is justified, rather than using frequent backups and VCS. Are there any existing solutions for this which don’t rely on a trash system from a graphical shell? ![]() Partial solutions for this exist, but the “restore” action in particular isn’t trivial. Furthermore, it’d be nice if the trash was automatically emptied on reboot (or a similar mechanism to prevent endless growth). A single mv ~/.trash is a first step, but ideally this should also handle trashing several files of the same name without overwriting older trashed files, and allow to restore files to their original location with a simple command (a kind of “undo”). Is there a Linux script / application which, instead of deleting files, moves them to a special “trash” location? I’d like this as a replacement for rm (maybe even aliasing the latter there are pros and cons for that).īy “trash” I mean a special folder.
0 Comments
Leave a Reply. |