0

When I make my bashRC file with nano ~/.bashrc. With only one alias:

alias c="clear"

I only can use the alias if I enter source ~/.bashrc or use . ~/.bashr, but I want this source to carry over to new terminal windows. Is there away to make this the default source? Or is there another way to make the bashrc permanent?

John Goofy
  • 1,330
  • 1
  • 10
  • 20
Miles Low
  • 23
  • 8
  • 1
    `.bashrc` is automatically sourced into interactive terminals that are not also login terminals. On MacOS, new tabs are login terminals, so they run `~/.bash_profile` instead. Easy answer is to `source ~/.bashrc` in your `~/.bash_profile`. – Charles Duffy Jun 05 '19 at 15:01
  • That said, note that this is generally a question for [unix.se], and off-topic here. Bash questions can definitely be topical if you're asking for help writing a script, but configuring an interactive terminal is in no way an act "unique to software development". – Charles Duffy Jun 05 '19 at 15:01

1 Answers1

-1

Add it to .bash_profile.

.bashrc is for noninteractive logins

if you are opening a new window and logging in manually you need to add it to .bash_profile

stickabee
  • 145
  • 8
  • Note the bullet point in the section *Answer Well-Asked Questions* in [How to Answer](https://stackoverflow.com/help/how-to-answer) about questions which "have already been asked and answered many times before", and also the one about questions which "are not about programming as [defined in the Help Center](https://stackoverflow.com/help/on-topic)". – Charles Duffy Jun 05 '19 at 15:04
  • Also, it's flatly wrong that `.bashrc` is "for noninteractive logins". It's for *interactive*, non-login shells. The only dotfiles executed for noninteractive shells is that named in the environment variable `BASH_ENV` (if it exists and the shell is bash), or `ENV` (for baseline-POSIX-compatible shells, or bash in POSIX mode). – Charles Duffy Jun 05 '19 at 15:06
  • 1
    *".bashrc is for noninteractive logins"* -- This is NOT true. –  Jun 05 '19 at 15:06