How do I get rid of this:(-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory) from my terminal? Every time I open Terminal this is on there like 50 times.

-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory
-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory
-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory
-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory
-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory
-bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory


I have no idea what I'm doing, I was just trying to get my Terminal to start with a folder and I found this online:

echo "cd "`pwd` &gt;&gt; ~/.bash_profile 


I used that when I was in the folder I wanted to start with on Terminal and it didn't work so being dumb I did it like 50 times so my Terminal always starts with a bunch of -bash: cd: /Users/Dakota/Documents/School/Spring: No such file or directory. It's ugly and I need it gone.
First we'll look at what the command did. The echo part returned the value of the arguments to the standard output. In this case, it wrote cd plus the response of the command pwd which returns the current directory. The &gt;&gt; part of the command writes the output of the command before it (in this case, the result of echo) to a file. The file it wrote to was ~/.bash_profile, which is a file of commands to run when bash is invoked. In this case, when you start your terminal.

To fix it, you can simply remove the lines that the command added. To do so, you can use Nano, which comes with your computer. Run nano ~/.bash_profile in terminal, and then remove the lines that say cd /Users/Dakota/Documents/School/Spring. Save your changes by pressing ctrl + x, and then press enter. Now, when you open a terminal window, you shouldn't be seeing those lines of text :)