Alias

From MEPIS Documentation Wiki

Jump to: navigation, search

You can provide your own name for commands using the alias command. In its simplest form, you just set your personal command name equal to the command:

alias cu='exit'

To make an alias permanent, you need to add it to the file ~/.bashrc (In MEPIS 11 add it to a file named ~/.bash_aliases). Note that if you are going to use the alias when root, you will need to copy (or recreate) that document in the /root directory. Here is a useful example of an everyday root alias:

alias up='apt-get update; apt-get upgrade'

This gives you a very fast method of upgrading your installed packages. Note that the alias in ~/.bashrc only affects newly started shells (you can just type bash to start a new shell inside the current one, or you can logout and login, or close the terminal and start a new one, or reboot).

To remove an alias, use unalias. From the example above, typing

unalias cu

would remove the alias. To make the removal permanent, just delete the corresponding line in ~/.bashrc.

Personal tools
In other languages