When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file/etc/profile, if that file exists. After reading that file, it looks for~/.bash_profile~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofileoption may be used when the shell is started to inhibit this behavior.
...
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrcand ~/.bashrc.


  • .profile is for things that are not specifically related to Bash, like environment variables PATH and friends, and should be available anytime. For example,.profile should also be loaded when starting a graphical desktop session.
  • .bashrc is for the configuring the interactive Bash usage, like Bash aliases, setting your favorite editor, setting the Bash prompt, etc.
  • .bash_profile is for making sure that both the things in .profile and .bashrcare loaded for login shells. For example, .bash_profile could be something simple like
    . ~/.profile
    . ~/.bashrc


댓글 0

목록
번호 제목 글쓴이 날짜 조회 수
공지 [정보] Noteworthy Composer(NWC) 사용법 & 팁 Taedong Yun 2012.05.07 118709
공지 [정보] 이메일 설정 Taedong Yun 2011.07.09 46725
공지 [정보] 중요 리눅스 커맨드 (계속 업데이트) Taedong Yun 2010.05.01 96605
공지 [자료] 시외버스 & 5005번 시간표 Taedong Yun 2005.03.11 60840
공지 [자료] Token Taedong Yun 2005.03.24 56761
공지 이름 대신 뜨는 이미지박스 신청 요령~ Taedong Yun 2004.02.25 55500
공지 - 의문사항 노트 Taedong Yun 2007.09.21 62856
공지 - 관심이 가는 책들 Taedong Yun 2005.01.15 54736
412 [정보] 구글 웹폰트 Taedong Yun 2011.12.07 10849
411 [정보] X220 Hotkey 안 될 때 해결책 Taedong Yun 2011.12.02 11597
410 [정보] YouTube 동영상 녹음하기 (Windows 7) Taedong Yun 2011.10.04 8938
409 [정보] Cisco AnyConnect VPN Client certificate error in Ubuntu Taedong Yun 2011.09.04 10501
408 [정보] How to uninstall Picasa in Ubuntu Taedong Yun 2011.09.02 6874
407 [정보] 우분투에서 Thinkpad X220 중간버튼 스크롤 Taedong Yun 2011.08.28 9119
406 [정보] 데스크탑에 안드로이드 설치하기 (virtualbox / vmware) Taedong Yun 2011.06.07 13794
405 [정보] Windows 7 한영키 문제 해결 Taedong Yun 2011.03.16 13364
404 [정보] 악보바다 악보 pdf로 저장 Taedong Yun 2011.02.10 44857
» [정보] 우분투 시작프로그램 .bashrc .profile .bash_profile 의 차이점 Taedong Yun 2010.11.10 81618
402 [정보] 우분투 키보드 리맵하기 Taedong Yun 2010.11.10 9352
401 [정보] 우분투 10.04 에서 창 버튼 오른쪽으로 옮기기 Taedong Yun 2010.11.10 8955
400 [정보] 우분투 리눅스에서 듀얼 모니터 상태로 동영상 보기 Taedong Yun 2010.11.09 8273
399 [info] 2011 Conferences Taedong Yun 2010.10.21 7683
398 [정보] BSO 공연 스케줄 2010 Fall Taedong Yun 2010.09.13 6589
397 [정보] XE (제로보드) 1.1.5에서 최신버전으로 업데이트 방법 Taedong Yun 2010.08.31 8056
396 [정보] 노트북 사용 까페 (한국) Taedong Yun 2010.06.01 6396
395 [정보] 2010 Fall Courses Taedong Yun 2010.05.18 6428