Aliases in Ubuntu

Johnny Rosenberg gurus.knugum at gmail.com
Wed Mar 24 17:27:25 UTC 2010


2010/3/24 Tom H <tomh0665 at gmail.com>:
>> Two questions about creating aliases in Ubuntu
>> 1) is it best practice to create an alias in ~/.bashrc or is it
>> preferable to create the alias in ".bash_aliases" ? If so, how do you
>> create an alias in ".bash_aliases" ? I can vim into ~/.bashrc but can't
>> seem to be able to vim into ~/.bash_aliases. I can cd into that
>> directory but it is empty since I have created my aliases into ~/.basrc.
>> 2) Is it best to use single or double quote when creating aliases.
>> ex: would alias dirA="echo Working directory is $PWD" be similar to
>> alias dirB='echo Working directory is $PWD'
>
> I have always used single quotes and seen others using single quotes.
>
> You can put your definitions in either file. If you put them in
> ~/.bash_aliases, make sure that it is sourced by ~/.bashrc.

I think the .bashrc file is already prepared for this. All you have to
do is to remove some ”#” at the beginning of some lines (and of course
create a .bash_aliases file).

>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list