If you’ve ever worked on Linux long enough, you know this story: you run a quick rm -rf something/, and only afterward realize… it was the wrong directory.

That happened to me (again). I tried to recover the data using xfs_undelete, but as often with XFS, the recovery failed — the deleted files were gone forever.

So instead of relying on recovery tools, I decided to make deletion itself safer. That’s how my small script, trash.sh, was born.


🗑️ What trash.sh Does

trash.sh is a lightweight Bash script that replaces risky rm operations with something safer. Instead of permanently deleting files, it moves them to a .trash directory on the same partition, appending a timestamp to avoid name conflicts.

Examp…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help