LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to define custom alias in Ubuntu ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-define-custom-alias-in-ubuntu-776345/)

Yan_Suryana 12-17-2009 03:26 AM

How to define custom alias in Ubuntu ?
 
Hello,
I am new here and my question is : How to define custom alias in Ubuntu automatically , so I can use it next time I do to login ?
Because every time I login, I need to define it using Terminal Mode.
I tried to put the command i. e "alias l='ls -l' in my .profile, but it didn't work, if I type alias it didn't come out what I put it .
Thanks.

JML 12-17-2009 03:34 AM

The filename that the line alias l='ls -l' goes in is .bash_profile rather than .profile in your home directory. If it still isn't working, make sure your terminal application is actually getting a true login shell.

~sHyLoCk~ 12-17-2009 03:38 AM

Put the alias in ~/.bashrc

Regards

Yan_Suryana 12-17-2009 04:20 AM

Thanks . .
 
Quote:

Originally Posted by ~sHyLoCk~ (Post 3795021)
Put the alias in ~/.bashrc

Regards

Thanks a Lot ~sHyLoCk~

Yan_Suryana 12-17-2009 04:22 AM

Thanks anyway . .
 
Quote:

Originally Posted by JML (Post 3795017)
The filename that the line alias l='ls -l' goes in is .bash_profile rather than .profile in your home directory. If it still isn't working, make sure your terminal application is actually getting a true login shell.

I couldn't find .bash_profile ..
But now I can define it in .bashrc

Thanks anyway ..

millig 12-17-2009 05:10 AM

Aliases
 
Don't put your custom aliases in .profile. Instead see the .bashrc in your home directory for adding aliases.

Yan_Suryana 12-17-2009 08:32 PM

Thanks
 
Quote:

Originally Posted by millig (Post 3795161)
Don't put your custom aliases in .profile. Instead see the .bashrc in your home directory for adding aliases.

I used to put aliases in .profile when I was working on SCO Unix about 15 years ago.

I am done with my aliases and put it in .bashrc

Thanks millig


All times are GMT -5. The time now is 02:18 AM.