By Manny Fernandez

May 1, 2020

banner

Switching back to Bash on new MacBook Pro

So I made the plunge during this coronavirus quarantine and bought the new 2020 MBP with 64GB of RAM.  Mostly because of the RAM but also for the new keyboard…. but I digress.  Well on my other MBP, I had upgraded from previous versions prior to macOS moving to ZSH instead of BASH.  I am pushing back and will hold out as long as I can with BASH.  Here is how to switch between the two.  This combines other posts I have done about removing ZSH warning, and another article about removing the computer name from BASH.

Lets get started

You can change the default shell per user.  By default, any new user will have the ZSH assigned to them.  Since I got a new laptop, I created a new user and it got the ZSH shell.  In your macOS GUI, go to System Preferences  then Users & Groups .

2020-05-01_18-35-29

You will need to unlock the security settings on the bottom left.

2020-05-01_18-36-32

Obviously, when the lock is closed, the configuration is ….. you guessed it… Locked.

2020-05-01_18-37-27

Once you log in, you should see the lock, unlocked.

Now you will find your user

Screen Shot 2020-05-01 at 6.37.58 PM

Next, we will hit the ^ or  the control key and click on the username to the left.  You should see Advanced Options , click that.

2020-05-01_18-39-20

As you can see, there is a Login shell section on this screen.

Screen Shot 2020-05-01 at 6.40.09 PM

You can choose the dropdown and choose from various shells.

Once this is done and you enter into the shell, you will see Computer Name on the screen.

You will now need to create a new file in the user home directory or ~ folder.

2020-05-01_18-43-22.pngYou will need to create the file. I use vi but you can use your favorite text editor.

cd ~
vi .bashrc

Once there, you will need to hit the lowercase i to edit.   Enter the line below.

PS1='\u:\w\$'

Once you enter the info, hit the esc key (Now a physical key on the new MBP) then :x and enter

Now we will make it so the changes take effect every-time you launch the terminal.

vi .bash_profile

2020-05-01_18-49-59.png

You will need to hit the lowercase i again and enter the following (as above)

source ~/.bashrc

export BASH_SILENCE_DEPRICATION_WARNING=1

Optional

Optionally, you run the following commands

chsh -s /bin/zsh to change back to zsh or chsh -s /bin/bash to move to bash

One you run the optional command, you will need to close the terminal app and reopen it.

Hope this helps

 

 

Recent posts