简体   繁体   English

zsh:找不到命令:服务

[英]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. 我读了一篇文章,建议我更改PATH变量。

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. 以上是我的〜/ .zshrc文件的外观。

Since I`m new to mac and also with zsh. 由于我是Mac和zsh的新手。

I clearly don`t know how to set up the PATH variable. 我显然不知道如何设置PATH变量。

I`m searching for solutions for hours but having difficulties 我正在寻找解决方案数小时,但遇到困难

I want to know how to setup the PATH variable. 我想知道如何设置PATH变量。

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 然后在.zshrc文件中,

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

add your NAME to the path like this: 将您的NAME添加到这样的路径中:

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. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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