본문 바로가기
Linux

service command not found 에러

by 짱닭 2022. 1. 5.
반응형

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

난 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

 

반응형

'Linux' 카테고리의 다른 글

ssh alias 설정  (0) 2022.11.02
ubuntu static ip 설정  (0) 2022.01.05
nvm으로 nodejs 설치하기(+ 버전변경)  (0) 2021.06.27
파일, 디렉토리 삭제  (0) 2021.04.15
Ubuntu CLI 명령어  (0) 2020.10.19

댓글