Terminal/ZSH Problems & Permission problems

malwarepermissionterminalzsh

I downloaded something out of the Internet and executed it, which might could have malware. After that I deleted all of that and i opened my Terminal and it gave me this error:

/Users/flawn/.zshrc:.:1: no such file or directory: /usr/local /etc/profile.d/z.sh
flawn@osx: ~|master⚡ ⇒  open .zshrc

These files exist and i could open it . I also tried to chmod all Files, but it didnt fix it. My fear is, that my system might not boot because of that permission errors…

Greetings

Best Answer

The error message- /Users/flawn/.zshrc:.:1: no such file or directory: /usr/local /etc/profile.d/z.sh comes from line 1 of your .zshrc file and suggests that there is a space between the command substitution and the rest of the path-

 . `brew --prefix` /etc/profile.d/z.sh
                  ^space

Back ticks for command substitution have been deprecated for a long time in favor of $(.....) but you would be better off using the absolute path to the sourced file-

. /usr/local/etc/profile.d/z.sh 

or comment line 1 out if z is not installed.

#. `brew --prefix` /etc/profile.d/z.sh

In line 20 remove the curly quotes-

DISABLE_UPDATE_PROMPT=„true“

Last, terminate the last line of your .zshrc file with a newline.