I installed zsh instead of bash and quite like it. However today I was changing the php path and I messed it up. I know what I did wrong, and I would just edit the file and fix it but my mistake has stopped any commands working. I could access it through finder, but the file I messed up on begins with a . so I need to run a terminal command so it shows up.

Any ideas on what I could do?

Anybody else having this issue: Don't panic! Here's what to do:

Temporarily fix it by running

export PATH="/usr/bin/:$PATH"
export PATH="/bin/:$PATH"

Then run nano ~/.zshrc and fix the issue (most common: having two PATH variables. Make them into one and separate different paths with a colon (:)). Then close nano and run source ~/.zshrc. Close your terminal (Cmd + Q) and reopen and try various commands (nano, ls, cd ect)

This worked for me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.