Where is history of deleted files?

Snobbias

New Member
Joined
Dec 4, 2020
Messages
16
Reaction score
5
Credits
178
I've made a little script that cleans up some files that I run manually. Anyway, I added a few "rm"-lines to remove files from a couple of folders. When I ran the script, those files were deleted but I lost more in the process. For instance, my desktop is now empty (which means I even lost the script which was placed on the desktop).

How do I check what was deleted? I can't find any command and I frankly don't know what to search for. I tried Ksystemlog but it only tells me that I ran the script. And, out of curiosity, why can't I find the deleted files in the trash bin?

I'm on Manjaro if it matters.
 


I'm not sure about Manjaro but in Linux Mint Cinnamon "Delete" is NOT the same as "Move to trash".

I'm thinking that the "rm" command is the same as Delete - meaning that the file is gone - unless you were to employ a file recovery software such as Photorec.

Probably just the header gets deleted and the space is marked as available. Could be recovered if not overwritten.
 
Do you have Timeshift setup ?
 
I'm thinking that the "rm" command is the same as Delete - meaning that the file is gone - unless you were to employ a file recovery software such as Photorec.

Correct - and added just 'cause you said "I'm thinking ..." The 'rm' command bypasses the trash can.
 
So... I got curious and hit up a search engine. I figured there was a way to change this behavior and, of course, there is.

Follow this link:

You can change the way the system behaves with regards to the 'rm' command. Those directions should make it so that your 'rm' commands will send the removed material to the trash can instead of completely deleting them.
 
So... I got curious and hit up a search engine. I figured there was a way to change this behavior and, of course, there is.

Follow this link:

You can change the way the system behaves with regards to the 'rm' command. Those directions should make it so that your 'rm' commands will send the removed material to the trash can instead of completely deleting them.

Yes I remember checking the parameters for rm to see if there was any "don't delete, send to trash bin" option, but in the Linux jungle I forget what I do occasionally :rolleyes:

Anyway, I was thinking the journaling system of the ext4 file system kept records somewhere by itself. Not sure how this works in Windows with NTFS since I've never tried. I don't really care if I've lost files, I just want to know what actually happened when I ran that script since I obviously made some mistake.

I've now spent some time searching for a solution, but it seems impossible to just get a list of recently deleted files. At least there is nothing natively in a Linux distro.

@Condobloke yes I'm using Timeshift but I excluded anything in the home folder and I'm not done setting up my backup yet. So I doubt it will help me in this case.
 
Actually, I figured out my wrongdoing. I had the wrong syntax for rm, so it deleted all files in the present folder, which happend to be the Desktop folder.
 
I suspect at least 50% of us have used an erroneous 'rm' command before.

I'm not a great sys admin, I'm great at keeping backups!
 
Actually, I figured out my wrongdoing. I had the wrong syntax for rm, so it deleted all files in the present folder, which happend to be the Desktop folder.
There are very few of us who have never made that mistake - yet :oops:
 
And "rm" IS the remove command :(

But, just like almost every FS in existence, a file is not completely gone until the FS reuses the inodes. And there are some utilities that MAY be able to recover some files. It just depends ...
 

Members online


Latest posts

Top