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
- an executable not having execute permissions for your user or group
- 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:
- 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.
- Add line export PATH="$PATH:/usr/sbin" . Note, that /usr/sbin is just an example, your location might be different.
- 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
반응형