Linux

service command not found 에러

짱닭 2022. 1. 5. 11:13
반응형

해당 명령어를 사용할 권한이 있는지 확인 후 권한 문제가 아니면

난 bash shell을 사용하므로 
~/.bashrc 파일에 
export PATH="$PATH:/usr/sbin"
추가해준다.
source ~/.bashrc
적용

 

원문:

command not found typically results from 2 cases

  1. an executable not having execute permissions for your user or group
  2. an executable not belonging to a folder listed in PATH variable , or the opposite - PATH variable that does not contain the location of your executable.

As have been solved in the comments , your case is #2. For future readers, the solution is as such:

  1. open your shell's configuration file in any text editor. If your shell is bash open ~/.bashrc , if your shell is zsh open ~/.zshrc. Note that ~ refers to your home directory.
  2. Add line export PATH="$PATH:/usr/sbin" . Note, that /usr/sbin is just an example, your location might be different.
  3. Save the file, exit and run source ~/.zshrc or source ~/.bashrc. Note, that for shells such as ksh or dash you will need to use . ~/.bashrc since source command is bashism and is not portable

 


https://askubuntu.com/questions/800155/service-command-not-found

 

service command not found

I'm trying to start ssh using: service sshd start but the service command can't be found, so it gives me an error: zsh: command not found: service What should I do?

askubuntu.com

 

반응형