This question already has an answer here:
- How to pass parameters to an alias? 5 answers
What I have:
alias killport='sudo kill -9 `sudo fuser -n tcp $1 2> /dev/null`'
killport 8000 doesn't appear to work, though. However, simply running...
sudo kill -9 `sudo fuser -n tcp 8000 2> /dev/null`
... DOES work. I can't figure out where I'm messing up.
The major difference between the working and non-working versions as far as I can see is that the aliased version involves a variable, and is executed by the shell for me.... But maybe someone has seen this kind of problem before and knows right where to look.