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.
Related videos on Youtube
Author by
Lesha Pipiev
Updated on September 18, 2022Comments
-
Lesha Pipiev over 1 year
I am under Ubuntu 12.04 LTS.
I have added such line to ~/.bashrcalias 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 almost 12 yearsThaks for help. source ~/.bashrc helped me. But why it isn't applied automatically when I am logging in?
-
Anju Fabulina almost 12 yearsThat 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 almost 12 yearsOh, thanks a lot. Iy works. It was a problem that I had bash_login file.
-
Sergio Abreu over 7 yearsusing . in place of source also runs .bashrc doesn't? >$ . .bashrc