In the next tutorial I will show you how to use alias to create our own custom commands to use from terminal.
Although I do not recommend it, this is very useful for the most used commands in our Linux distro based on DebianIn this case Ubuntu 12.10.
The question of not recommending the use of tools like alias, is that despite its great utility, it can be counterproductive especially for users who are starting with this of Linux and its terminal, since although it is very useful and friendly to use custom commands, it can make us forget the real commands to use.
How to use aliases to create your own commands
Alias It is already installed by default in our Ubuntu, so to use it we will only have to edit the .bashrc file found in the Personal Folder in a hidden way.
The pattern to follow to create our own custom commands will be the following:
alias custom command= "original command»
The parts in italics will be the ones that we will have to change for our custom command and command to replace.
We will open the file .bashrc with the following command:
- sudo gedit ~ / .bashrc
Now we will add the lines with our custom commands, at the end of the file, as I indicate in the following screenshot:
At the beginning we will put:
# Start my commands
And we will finish our custom commands closing with this line:
# End of my commands
We will save the changes in the File .bashrc and we will activate them with the following command: ç
- source ~/.bashrc
Now for update the list of repositories, as we have created the pertinent shortcut, we will only have to put the terminal to update:
As I said, it is a very useful tool for create our own commands and thus simplify the use of the terminal, although it should not be abused so as not to forget the real commands.
More information - How to rename files in bulk in Linux