This question already has an answer here:

I use following commands very often, and they're too long.

sudo /etc/init.d/kerio-kvc start
sudo /etc/init.d/kerio-kvc stop

how can I create a shortcut command for them? something like sudo kerio start or sudo kerio stop

marked as duplicate by user4556274, Jeff Schaller, G-Man, Kiwy, Dmitry Grigoryev Mar 19 '18 at 9:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Edit your ~/.bashrc file, then add an alias:

alias kstart='sudo /etc/init.d/kerio-kvc start'
alias kstop='sudo /etc/init.d/kerio-kvc stop'

Then :

source ~/.bashrc

Now kstart and kstop are accessible.

Note :

most of linux distros now use systemd, so it would be :

sudo systemctl start kerio-kvc

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