Can we undo operations done in a terminal, for example, file deletion through rm?
Solutions obtained:
- Aliasing
- Undelete utilities
- Backup utilities
- LibCrash
- Versioning (FUSE)
|
Can we undo operations done in a terminal, for example, file deletion through
| ||||
|
feedback
|
|
There is no general "undo" for every operation in terminal. If you wish to recover a file after using An option to prevent you from future mistakes is to make a second
that way you will be prompted for confirmation of future deletes. You could also move files deleted by
| |||||||||||||||||||||
feedback
|
|
There is no recycle bin for the command line. You could try some of the various undelete utilities, but there's no guarantee that they would work. | |||
|
feedback
|
|
You could use trash-cli if you use KDE when you run a gui. This is command line utility to delete/restore using the KDE trash facilities. | |||||
feedback
|
|
You could make
This is preferable to btw I would have posted this in a comment but I don't have enough rep. | |||||||
feedback
|
|
There's a larger question here that's worth addressing. Shell commands are not chatty (they don't double check what you want), and they expect you to know what you're doing. This is fundamental to how they are designed. It's a feature, not a bug. Some people find this macho, which I think is pretty silly, but it is important to understand. You can do a great deal of damage in a terminal, even if you're not root. I think you probably really just cared about | |||
|
feedback
|
|
Two more technical solutions have not be named yet:
| |||
|
feedback
|
|
Option 1: http://www.stud.tu-ilmenau.de/~mojo/undelete.html OPtion 2: I have rsnapshot (rsync) running on my machine which makes snapshots hourly of my selected folders. It incrementally does this every hour, 2 hours or whatever you tell CRON to do. After a full day it recycles these snapshots into one daily snapshot and after 7 days in a weekly so on and so on. This makes me able to go back in time for about a month or so for every hour! It is pretty good with disk space as it creates symbolic links to files which never changed... | |||
feedback
|
|
There exist undelete utilities for ext2, but most other Linux filessytems are stuck in the stoneage and don't have any advanced usability features. Sad state of affairs considering gigantic drives with enough space to ever delete a file again are common place. So you are stuck with three options:
Do all three for maximum amount of safety. | |||
feedback
|
|
Recover using grep on
Just a try. | |||||
feedback
|
|
here´s a garbage_bin script. http://hermanningjaldsson.com/unix/garbage_bin/ | |||
|
feedback
|