简体   繁体   中英

zsh: command not found: service

when i run the command

service mysql restart 

following with the message like

zsh: command not found: service

and I can`t figure how to solve this problem.

I read an article which recommends me to change the PATH variable.

1 # If you come from bash you might have to change your $PATH.
2 export PATH=$HOME/bin:/usr/local/bin:$PATH
3
4 # Path to your oh-my-zsh installation.
5 export ZSH=/Users/jameskoo/.oh-my-zsh

Above is what my ~/.zshrc file looks like.

Since I`m new to mac and also with zsh.

I clearly don`t know how to set up the PATH variable.

I`m searching for solutions for hours but having difficulties

I want to know how to setup the PATH variable.

Any recommendations would be appreciated..

You could add your service like this:

export NAME=/path/to/your/service

and then, in the .zshrc file, in the line

export PATH=$HOME/bin:/usr/local/bin:$PATH

add your NAME to the path like this:

export PATH=$HOME/bin:/usr/local/bin:$NAME:$PATH

Save it and then read the source with:

> source ~/.zshrc

And you're good to go. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM