Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In zsh 'kill' is a built-in.
I would like to alias killall to kill, as I use 'killall' more often and aliasing it kill would be more convenient. i would like to retain the ability to use kill, however, if possible by aliasing it to 'pidkill' or something of that nature.

How might I accomplish this? or is there a more convenient route i might take that i am not aware of?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

What you're asking is easily accomplished by aliasing kill to killall. If you want to use kill, simply type '\kill' instead. Starting with a backslash disables aliases. Taking this further to accomplish what you want:

alias kill=killall
alias pidkill='\kill'

But more to the point, as Nuno Cordeiro said, try not to do it for the same reasons he stated, that too with a command like kill.

share|improve this answer
add comment

Short answer: don't do it.

Explanation: Even if you find a way to do it you will be breaking the expected behavior of your system and you will be creating a mental habit for you that will not work on standard systems.

If you really want this then create a new command alias (that doesn't match any built-in) and use that. Something like kall sounds perfect to me....

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.