5
0
I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:
alias rm=trash
This works fine as a normal user, and it works fine when I use sudo -i
to get a root shell prompt, but if I use sudo rm
, the alias does not apply. So where do I need to put my alias so that it works in one-off sudo commands?
http://serverfault.com/questions/61321/how-to-pass-alias-through-sudo – Ciro Santilli 新疆改造中心法轮功六四事件 – 2015-08-09T19:42:01.057
1
You don't specify if you are on OS X, but if so, check out the osx-trash command. Very useful: http://www.dribin.org/dave/osx-trash/ But as others have said, don't alias rm. Just get in the habit of typing "trash" instead.
– None – 2010-09-25T20:18:52.533