Reputation: 83
When i try to do ls in the terminal, it says command not found.
Before I broke everything, the output of echo $PATH was something like this:
/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/gabrijelagavric/.gem/ruby/2.6.5/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/bin:
I was trying to follow along with some threads but I don't seem to understand what specifically I need to run to change my .zshrc file (this thread said to change PATH variable in .zshrc: commands not found on zsh)
So, I pasted this into the terminal:
echo "export PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/gabrijelagavric/.gem/ruby/2.6.5/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/bin:" >> ~/.zshrc
And then source ~/.zshrc"
But then i got this response
/Users/gabrijelagavric/.oh-my-zsh/oh-my-zsh.sh:117: command not found: rm
detect-clipboard:33: command not found: uname
/usr/local/opt/chruby/share/chruby/chruby.sh:5: command not found: ls
/Users/gabrijelagavric/.zshrc:export:107: not valid in this context: /Users/gabrijelagavric/.gem/ruby/2.6.5/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/bin:/Users/gabrijelagavric/.rubies/ruby-2.6.5/bin:```
Upvotes: 1
Views: 10041
Reputation: 2092
Since I broke my path while tweaking things in my .zshrc, I could not enable "show hidden files" with the terminal command. Here are the steps I took:
VS Code, Atom, Sublime, etc
)Finder
and navigate to your user (you can right click the folder name at the top to get a dropdown of your current folder and it's parents)⌘⇧.
(Command-Shift-Dot
) to show hidden files.Upvotes: 0
Reputation: 83
The way I fixed this was following the answer provided by "user1934428" in their comment (though they didn't actually answer it so I don't know how to specify they resolved it"
Their suggestion was to edit the file in a text editor.
Thank you user1934428, your solution helped. Thank you to Mashuptwice and Chapner as well for answering as well.
Upvotes: 5
Reputation: 695
You've added the new $PATH
variable as last line (>>
) to your .zshrc
file. Remove the last line of the file to revert the changes.
If you want to add a path to $PATH
in the future, you can use PATH=$PATH:/new/path/appended/to/variable
to add something to the variable, without completely replacing it.
Upvotes: 0