How to clean up messy bash profile safely?

Hi. I am reviewing the Lingua Franca Command Line project and am stuck on Task 18.

https://www.codecademy.com/courses/learn-the-command-line/articles/command-line-offline-project

I think because I’ve already previously completed this project, all the commands that I had typed are still in my ~/.bash_profile. It’s so messy in there! How do I clean it up and reset (? is that the right word) so that I can review and redo Tasks 18 - 26?

Not sure if my following problem is related to the original question above. But I went into my bash profile terminal and manually pressed my “delete” key to clear the terminal. Then I went ahead and did the Ctrl + O → Enter → Ctrl + X → source ~/.bash_profile … and I proceeded with Tasks 18-21. But I don’t think whatever I did with the “deleting” worked. Because when I did Task 22, I got the following message …

/Users/myname/.bash_profile:4: bad assignment
md=mkdir

I then went back into my bash terminal and did it all again, this time cutting and pasting from the Solution for Task 20. But I still received the same “bad assignment” message.

Someone please help? This is all so jargony to me.

you’re on a Windows OS, yes?

I would first make a backup copy of the file (so if you mess it up, then at least you have a copy of it).

Did you watch the YT video from Farish?
https://www.codecademy.com/courses/learn-the-command-line/articles/command-line-setup

See also:
https://blog.devgenius.io/how-to-customize-the-git-bash-shell-prompt-336f6aefcf3f

https://medium.com/@techpreacher/using-git-bash-with-the-microsoft-terminal-bd1f71fa17a1

Hi Lisalisaj. Not Windows. I am learning coding on my 2021 MacBook Air which I checked just now and am being prompted to update the software to macOS Ventura.

Whoops, my bad. Also, I didn’t know there was a new Mac OS available. :woman_facepalming:

I’m assuming that you used nano to edit the file in the lesson, right?
This might help:
nano .bash_profile

make changes/revert back to what it was before you added the stuff from that lesson. Then save & exit:
ctrl + x'
You’ll be prompted if you want to save the changes.

this might be useful:

1 Like