본문 바로가기
나머지/IT개발.잡다한것.

bash_profile을 찾을수가 없었다....

by 무늬만학생 2012. 4. 19.
반응형

find / -name '.bash*'


검색을 해봤는데 안나와...


ls -a 해도 안나와...



root로 접속후 검색해도 안나와..


.bashrc란것이 있었다......


차이점은 


.bashrc는 bash이 실행될 때마다 수행되고, .bash_profile은 bash이 login shell로 쓰일 때(즉 처음 login할 때)에 수행됩니다.


child shell은 부모로부터 환경변수를 이어받으니 .bashrc에서 따로 PATH를 설정해 줄 필요는 없습니다만... GUI 환경에서 새 terminal을 여는 경우에는 login shell로 처리되지 않으므로 주의가 필요합니다.

출처 :http://kldp.org/node/38265



참고 : http://mwultong.blogspot.com/2006/10/linux-bashrc-bashprofile.html


Both the ~/.bashrc and ~/.bash_profile are scripts that might be executed when bash is invoked. The ~/.bashrc file gets executed when you run bash using an interactive shell that is not a login shell. The ~/.bash_profile only gets executed during a login shell. What does this all mean? The paragraphs below explains interactive shells, login shells, .bashrc, .bash_profile and other bash scripts that are executed during login.


Login Shells (.bash_profile)


A login shell is a bash shell that is started with - or --login. The following are examples that will invoke a login shell.


sudo su -

bash --login

ssh user@host


When BASH is invoked as a login shell, the following files are executed in the displayed order.


/etc/profile

~/.bash_profile

~/.bash_login

~/.profile

Although ~/.bashrc is not listed here, most default ~/.bash_profile scripts run ~/.bashrc.


Purely Interactive Shells (.bashrc)


Interactive shells are those not invoked with -c and whose standard input and output are connected to a terminal. Interactive shells do not need to be login shells. Here are some examples that will evoke an interactive shell that is not a login shell.


sudo su

bash

ssh user@host /path/to/command


In this case of an interactive but non-login shell, only ~/.bashrc is executed. In most cases, the default ~/.bashrc script executes the system's /etc/bashrc.


Be warned that you should never echo output to the screen in a ~/.bashrc file. Otherwise, commands like 'ssh user@host /path/to/command' will echo output unrelated to the command called.


Non-interactive shells


Non-interactive shells do not automatically execute any scripts like ~/.bashrc or ~/.bash_profile. Here are some examples of non-interactive shells.


su user -c /path/to/command

bash -c /path/to/command


For more information, see the bash man page.

출처 : http://hacktux.com/bash/bashrc/bash_profile



.bash_profile을 찾을수가 없습니다.


프로그램을 설치하고 경로를 지정해 주려고 합니다.

그런데 .bash_profile 을 찾을수가 없습니다.ㅠ_ㅠ

gedit .bash_profile 이라고 치면 나온다고 하시는데...저는 빈 파일만 나옵니다.

gedit ~/.bashrc 라고 치면 이거는 나오는데 이 파일의 위치는 찾을수가 없습니다.

보통 루트 나 홈 에 있다고 하시는데 저는 도무지 찾을수가 없습니다.

현재 우분투 9.04 를 사용하고 있습니다.

부디 무지한 저에게 한줄기 빛을 내려 주시길 부탁드립니다.

감사합니다~


댓글

~ (유저홈) 에 .bash_profile 파일은 없습니다.

그러니 당연히 빈파일로 나오죠 ...

bash 쉘의 환경 설정은 .bashrc 이며

개별 설정 파일은 .profile 입니다. ^^

출처 : http://www.ubuntu.or.kr/viewtopic.php?p=26286

반응형