Ubuntu alias not applied in bashrc

10,908

I think it should be

alias myconf='sudo nano /opt/nginx/conf/sites-available/efiling'

with single-quotes instead of double-quotes.

You can also use

$ source ~/.bashrc

to load bash.rc without closing the terminal/logging out.

Share:
10,908

Related videos on Youtube

Lesha Pipiev
Author by

Lesha Pipiev

Updated on September 18, 2022

Comments

  • Lesha Pipiev
    Lesha Pipiev over 1 year

    I am under Ubuntu 12.04 LTS.
    I have added such line to ~/.bashrc

    alias myconf="sudo nano /opt/nginx/conf/sites-available/efiling"
    

    I tried with single quotes too:

    alias myconf='sudo nano /opt/nginx/conf/sites-available/efiling'
    

    Then I logged out and logged in again.

    test@STORK:~$ myconf
    myconf: command not found
    

    But after test@STORK:~$ source ~/.bashrc it works.

    Can Anyone help me?

  • Lesha Pipiev
    Lesha Pipiev almost 12 years
    Thaks for help. source ~/.bashrc helped me. But why it isn't applied automatically when I am logging in?
  • Anju Fabulina
    Anju Fabulina almost 12 years
    That looks okay. What about the two files ~/.bash_profile and ~/.bash_login, do these exist on your system? Because in my default .profile file the comment at the top says that, "This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists."
  • Lesha Pipiev
    Lesha Pipiev almost 12 years
    Oh, thanks a lot. Iy works. It was a problem that I had bash_login file.
  • Sergio Abreu
    Sergio Abreu over 7 years
    using . in place of source also runs .bashrc doesn't? >$ . .bashrc