Dev/Mac모닝
Mac Path 경로 설정
healthyryu
2021. 11. 3. 15:58
* 터미널 설정에 따라서 bash_profile or zshrc 에 경로 설정을 해야한다.
필자와 같이 터미널이 zsh 로 기본 으로 되어 있다면 bash_profile 을 할 경우에는 매번 source ~/.bash_profile 처리를 해야하기 때문에 zshrc 로 처리하는게 편할 것이다.
bash_profile 과 zshrc 의 차이 설명 링크
1. open
(1) bash_profile 열기 (새 창으로 뜬다)
open -e ~/.bash_profile
or
open -e ~/.zshrc
(2) bash_profile 에서 경로 추가
export PATH=$PATH:{플러터 폴더 경로}/bin
필자의 경우 export PATH=$PATH:/Users/hoon/flutter/bin
(3) 변경된 bash_profile 적용하기!!(필수)
source ~/.bash_profile
or
source -e ~/.zshrc
2. vi
(1) bash_profile 열기
vi ~/.bash_profile
or
vi ~/.zshrc
더보기

vi 로 bash_profile 동작 화면

(2) bash_profile 에서 경로 추가
키보드 "i" 를 눌러서 insert 모드로 만들고 경로 입력 한다.
export PATH=$PATH:{플러터 폴더 경로}/bin
esc 를 누르면 해제 된다. 그리고 :wq 를 입력하고 Enter 키 누른다
*:wq 저장후 종료
(3) 변경된 bash_profile 적용하기!!(필수)
source ~/.bash_profile
or
source ~/.zshrc
3. nano
(1) bash_profile 열기
nano ~/.bash_profile
or
nano ~/.zshrc
(2) bash_profile 에서 경로 추가
커맨드 명령에 따라서 입력 후 Exit 처리르 하면 된다.
export PATH=$PATH:{플러터 폴더 경로}/bin
(3) 변경된 bash_profile 적용하기!!(필수)
source ~/.bash_profile
or
source ~/.zshrc
반응형