Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to create a Unix alias, that allows me for example to type l for ls -l. Nevertheless, I do not want to modify the file /etc/bash.bashrc as that one applies to all users I believe.

How can I set the alias only for my user?

share|improve this question

migrated from stackoverflow.com May 7 '13 at 14:33

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 1 down vote accepted

You can edit the ~/.bashrc file located in your home user directory. This way the alias will apply just to your user.

You can check the comprehensive information about this in What's the difference between .bashrc, .bash_profile, and .environment?.

share|improve this answer
    
I tried to do it, adding the line alias l='ls -l' to that file, but I still get l: command not found. Any ideas? –  Alphaaa May 7 '13 at 13:17
1  
You have to source the file after updating. Just do this in your prompt: source ~/.bashrc. New alias will be loaded. –  fedorqui May 7 '13 at 13:19
    
So... did it work, @Alphaaa ? –  fedorqui May 7 '13 at 14:05
1  
It just worked, great! –  Alphaaa May 7 '13 at 14:15
    
Good to read that, cheers. –  fedorqui May 7 '13 at 14:18

Edit ~/.bashrc to change your user settings in this way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.