Among many other reasons, this is one more why I always prefer to use a GUI than a terminal shell. The default delete operation is just sends files to trash, and that’s easily undoable. I think you can even press Ctrl+Z to do so (can’t check atm).

I don’t even know how to do that from commandline.

(one online search later…)

There’s a package for that but best I can tell there’s no universal way.

Can files/directories deleted with rm be restored?

Is it possible to restore files/directories which are deleted from terminal using rm and rm -r?. If a file is deleted from graphical interface, it could be restored from trash, but how do you resto...

Ask Ubuntu
The fear is real but in 30 years of unix and linux work, i’ve never actually deleted anything I didn’t mean to.
I once tried to delete the .steam folder off of an hold SSD, but the .steam folder is a symlink :(