Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I create an alias so that when I enter "kt" it executes "killall gnome-terminal"?

share|improve this question
up vote 7 down vote accepted

Creating an alias

  • To add an alias type the following in terminal,it will work until you close your terminal.
    alias kt='killall gnome-panel'
  • To add this alias permanently you have to add the above command into .bashrc file
    gedit ~/.bashrc
  • Add the first command at the end of your .bashrc file,
    alt text
  • To refresh your .bashrc file type the following in terminal,
    . ~/.bashrc or source .bashrc
  • Now you can type kt in terminal it will perform the action of killall gnome-panel
  • To list all your aliases type alias in terminal.
    alt text

Few examples:

  • To create an alias for update,you have to add the following to your .bashrc
    alias update='sudo apt-get update'
  • For upgrade
    alias upgrade='sudo apt-get upgrade'
  • To add both update and upgrade you can do the following
    alias upd='sudo apt-get update && sudo apt-get upgrade'


  • Source command is used for applying the changes that you have just made in a configuration file.
  • By ændrük suggestion you can also put your custom aliases in ~/.bash_aliases
share|improve this answer
It would be cleaner to put custom aliases in ~/.bash_aliases. Ubuntu's default ~/.bashrc sources this automatically. – ændrük Dec 25 '10 at 7:40

Just type alias kt="killall gnome-terminal" in command line (I assume you're bash user).

To make this changes permanent, you can put this line to your .bashrc, for example. Execute echo 'alias kt="killall gnome-terminal"' >> ~/.bashrc (don't forget to re-apply changes using . ~/.bashrc)

Use simple alias command to see the list of aliases in action.


update: BTW, you may find this useful as well: Problem with creating permanent alias

share|improve this answer

Your Answer


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.