分类: LINUX
2011-02-04 10:10:56
Alias is a command that enables a replacement of a word with another string. It’s mainly used for abbreviating a system command, or for adding default arguments to a command which one regularly uses.
Under Ubuntu your bash alias is under your directory. To view your current collection of aliases all you need to do is load up a terminal. To do this just go to Applications > Accessories > Termininal
Once there, type the following:
This changes the directory to the location of your folder. For me when that command is completed I see:
Now enter the following:
This will open up your bash configuration file. There are many options already in there and much more you can add. For what we are trying to do, find this:
As it states, just uncomment (by removing the #’s) if statement. After you do so, it should look something like so:
Save the file and close gedit. Now back in the terminal type:
That will open up gedit again but the file you will probably see will be blank. (However, some of you might not have a blank file, that’s okay). Add the following to the file.
Remember, you can add any other command you might want. I have added a few more to mine.
Close the file and reload the terminal. This will reload your bash profile and thus contain your aliases. To check your list of aliases, type alias in your terminal.
Note: Be careful with the sudo command.