백엔드
오류) 리눅스 ls -al 명령어 오류
뽀짝코딩
2022. 9. 28. 17:13
728x90
오류 메시지
Command 'ls' is available in '/bin/ls' The command could not be located because '/bin' is not included in the PATH environment variable. ls: command not found
상황
vim .profile 편집하는 중에 갑자기 멈춰서 강제로 cmd 종료하고 ls -al 명령어 입력하니 오류가 났다.
해결
검색해보니
PATH변수가 엉망인 것 같다 . 아래 명령어를 입력하라 해서 따라해봄
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
위 명령어는 일회성 이라서 vagrant 들어갈때 마다 입력야한다. 불편해서 다른방법을 찾아봤다.
아래 명령어로 PATH를 수정한다.
vi ~/.bash_profile
vim 모드로 전환되는데 위 export~ 문장을 그대로 저장했다.
vim 모드 나올때는 강제저장나가기- shift + : > wq!
아래 명령어로 새로고침/적용 ?
source ~/.bash_profile
참고
반응형