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 119499
공지 [정보] 이메일 설정 Taedong Yun 2011.07.09 46727
공지 [정보] 중요 리눅스 커맨드 (계속 업데이트) Taedong Yun 2010.05.01 96659
공지 [자료] 시외버스 & 5005번 시간표 Taedong Yun 2005.03.11 60843
공지 [자료] Token Taedong Yun 2005.03.24 56763
공지 이름 대신 뜨는 이미지박스 신청 요령~ Taedong Yun 2004.02.25 55501
공지 - 의문사항 노트 Taedong Yun 2007.09.21 62857
공지 - 관심이 가는 책들 Taedong Yun 2005.01.15 54793
414 하푸움... [3] 이은정 2004.03.20 5995
413 제발 개념을 좀 가졌으면.. 윤태동 2005.01.18 5995
412 게시판 통합~ 윤태동 2004.06.29 5996
411 설 연휴 TV 영화 가이드 file 윤태동 2005.02.08 5998
410 어린신부. [3] 윤태동 2004.04.11 6001
409 메일 열기만 해도 감염.. 베이글 웜 급속확산(상보) 윤태동 2004.03.18 6002
408 개념있는 부자가 됩시다 윤태동 2005.02.05 6003
407 [정보] ETS GRE Center 전화번호 윤태동 2007.10.04 6005
406 정보처리기사 [1] 윤태동 2005.01.17 6006
405 [영상] 소니의 하이퍼드래깅(멋짐) 윤태동 2005.04.04 6006
404 [정보] 컴퓨터 속도 향상 [1] 윤태동 2004.08.15 6013
403 Bloomberg Radio 윤태동 2004.05.21 6015
402 흠.. 태동 받아라..ㅎ [3] file 김정훈 2006.11.02 6016
401 러플린 교수 KAIST 총장 취임~! 윤태동 2004.05.28 6018
400 [기타] 금융 관련 자격시험 윤태동 2005.08.08 6018
399 MSK 합격! [3] 윤태동 2004.03.18 6020
398 어? 지금알았다-_-; [1] 이은정 2004.03.27 6021
397 [정보] 홈페이지 강좌 및 사랑비 bgm 사용법 윤태동 2006.11.01 6021
396 [자료] 2009 Spring Timetable file Taedong Yun 2009.02.03 6021
395 캬... 정말... [1] Fanta 2004.04.17 6023