2010.11.10 17:06
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 --noprofile
option 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.bashrc
and ~/.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 .bashrc
are loaded for login shells. For example, .bash_profile
could be something simple like. ~/.profile
. ~/.bashrc
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | [정보] Noteworthy Composer(NWC) 사용법 & 팁 | Taedong Yun | 2012.05.07 | 119411 |
공지 | [정보] 이메일 설정 | Taedong Yun | 2011.07.09 | 46727 |
공지 | [정보] 중요 리눅스 커맨드 (계속 업데이트) | Taedong Yun | 2010.05.01 | 96654 |
공지 | [자료] 시외버스 & 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 |
6 | [정보] 악보바다 악보 pdf로 저장 | Taedong Yun | 2011.02.10 | 44863 |
5 | [정보] 우분투 12.04 에서 한영키와 alt키가 같이 눌리는 문제 | Taedong Yun | 2012.04.28 | 46111 |
4 | [정보] 안드로이드 - 저장된 WIFI 비밀번호 보기 | Taedong Yun | 2014.08.17 | 51161 |
» | [정보] 우분투 시작프로그램 .bashrc .profile .bash_profile 의 차이점 | Taedong Yun | 2010.11.10 | 81618 |
2 | [정보] Google Calendar Sync to iPod touch | Taedong Yun | 2010.02.12 | 87203 |
1 | 윈도우 프로세스 라이브러리 | 윤태동 | 2004.05.29 | 183617 |