I know this is a discussion of Unix in general, but on your own Mac, you can get `trash` packages for the terminal [0] [1].
I use the former, I haven’t tried the latter. But afaict, they should be pretty much identical – they both supply `trash <path>` which could, for most intents and purposes, probably be aliased as `rm`.
One thing to note is that none of these tools seem to support the “Put Back” feature of Finder. Trashed files don’t remember their original locations. But I’ll personally still choose that over being nervous before every `rm`.
[0] – https://formulae.brew.sh/formula/trash [1] – https://formulae.brew.sh/formula/macos-trash
Yea sure.. but again a big recurring theme of The Unix Haters Manual is "broken by default". That things can be fixed isn't the point, if the fix is local, ephemeral, easily forgotten, and the fix not being implemented is blamed on the user because "you can fix it".
Broken by default is itself exactly the problem.
Really? Afaik filesystems still do `rm` immediately and with no recourse. GUIs on top like Finder and Explorer do something more sane though, but that doesn't save us terminal users.
POSIX shell expansion is just as crazy as it has ever been too.
Those are the two gigantic foot guns I can recall from memory from having read this 20 years ago.