0

Despite the fact that I added some commands in .bashrc, I have to say "source ~/.bashrc" each time after rebooting.

.bashrc

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH=/opt/scala/sbt-0.12.2/bin:$PATH

Without saying "souce ~/.bashrc" the command sbt doesn't work.

No command 'sbt' found, did you mean:
 Command 'st' from package 'suckless-tools' (universe)
 Command 'sb' from package 'lrzsz' (universe)
 Command 'mbt' from package 'mbt' (universe)
 Command 'sbd' from package 'cluster-glue' (main)
 Command 'sb2' from package 'scratchbox2' (universe)
 Command 'skt' from package 'latex-sanskrit' (universe)
 Command 'sbmt' from package 'atfs' (universe)
 Command 'lbt' from package 'lbt' (universe)
sbt: command not found
  • It is in a graphic terminal or in a virtual console, or in ssh? Do you have a .profile or .bash_profile? – enzotib Sep 2 '13 at 5:58
  • this is a console app. – Alan Coromano Sep 2 '13 at 6:02
  • .bashrc is for interactive non-login shell, for Ubuntu it works with ~/.profile. If you have a ~/.bash_profile (for interactive login shell), the above-mentioned 2 won't be loaded. – Terry Wang Sep 2 '13 at 6:15
3

Some basics: .bashrc is for interactive non-login shell, while ~/.bash_profile is for interactive login-shell.

For

  • Interactive non-login shell, initialization order: System wide bashrc (SYS_BASHRC) default /etc/bash.bashrc => ~/.bashrc

  • Interactive login shell, initialization order: /etc/profile [^sysconfdir] => ~/.bash_profile => ~/.bash_login => ~/.profile.

Ubuntu by default uses ~/.profile to load ~/.bashrc, if ~/.bash_profile exists, ~/.profile and ~/.bashrc will NOT be loaded at shell initialization.

So make sure you don't have a ~/.bash_profile, put what you want in ~/.profile and ~/.bashrc.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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