Live data from Hacker News

Stop Using `rm` in Bash. Use `del`

news.ycombinator.com

71–76 of 76 posts

Re: Stop Using `rm` in Bash. Use `del`

#74

This can be a pain if you're deleting many files, but alias rm='rm -i' has worked for me.

Okay I think this is more elegant than my workaround. But it doesn’t work for directories, does it?

When I execute "rm -r" with that alias, it does prompt me before deleting directories, at least on Mac OS.

Re: Stop Using `rm` in Bash. Use `del`

#75

This can be a pain if you're deleting many files, but alias rm='rm -i' has worked for me.

Okay I think this is more elegant than my workaround. But it doesn’t work for directories, does it?

BTW, if I'm absolutely sure I want to delete all the files in a directory and all subdirectories, and I don't want to bother with a gazillion prompts, I can override the alias with a backslash, as in "\rm -r *". Use with extreme caution, though. Otherwise, your solution of putting into Trash is probably better and safer.

Re: Stop Using `rm` in Bash. Use `del`

#76
I already have an alternative for Windows users. Doesn't provide any data retention mechanism, but still helpful:

  $ ls -l /usr/local/bin/del
  lrwxrwxrwx 1 root root 13 Mar 18 12:46 /usr/local/bin/del -> /usr/games/sl
Post reply on HN