LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2010, 03:19 AM   #1
ramanujulu
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Unable to find .bash_profile


Hello friends,

I am new to linux field. Plz allow me to be a part of the team.

I have installed oracle11g R2 on ubuntun 10.04, upon completing I need to set the profile with environment variables but, could not locate the .bash_profile

Any help is greatly appreciated.
 
Old 12-13-2010, 03:39 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
~/.bash_profile does not exist by default so you normally need to create it. Files beginning with a . are conventionally hidden so if looking for it with the ls command you need an option like -a and if using a graphical file system browser you may need to switch it to display hidden files (Ctrl+H on some).
 
Old 12-13-2010, 03:44 AM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi ramanujulu and welcome to LQ,

this is a very good question since (my experience) most distributions go their own way.

The bash manpage says: if Bash is started as a login-shell, it reads /etc/profile and then (if present) the .profile in you home directory. If Bash is invoked not as a login shell, it reads the .bashrc in your home directory.

As a short answer to your question: if you don't have either a .bashrc nor a .profile, to find it out execute
Code:
ls -a
within your home directory, then create a .bashrc, put the new environmentvariables into the file and make a symbolic link
Code:
ln -s .bashrc .profile
As I said most distributions go their own way, take a look at the Ubuntu manuals and at the manpage
Code:
man bash
as well.

Markus

Last edited by markush; 12-13-2010 at 09:05 AM. Reason: forgot to say welcome and typo
 
1 members found this post helpful.
Old 12-13-2010, 06:08 AM   #4
ramanujulu
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Hi there, I tried to locate those files as you are said. I found .profile when I try to edit it says The Link ".profile" is broken. Move it to trash ? The link can't be used, because its target ".bashrc" does not exist.

Do i need to create a new file as .profile and add the parameters? if so how do i associate this file with the system. can u plz.. give me the steps to do the same. I have stuck here after installing oracle 11g and could not start SQL prompt...

I need to set oracle_home and path environment variables...

Thanks
 
Old 12-13-2010, 09:04 AM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Well, you should create a .bashrc file, the link .profile does only work if the .bashrc exists.
Just try it out, if it doesn't work for you, you can delete it.

Be sure to execute
Code:
source .bashrc
within the homedirectory in order to make the new environmentvariables working.

Markus
 
Old 12-13-2010, 01:02 PM   #6
ramanujulu
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Need help

Sorry guys,

I am very new to linux. I simply installed the oracle 11g what are my post installation steps and how ? how do I start SQL and what are the steps I need to do after installing this oracle 11g. This will help me to resume the practice...

Thanks
 
Old 12-15-2010, 04:09 AM   #7
ramanujulu
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Partially resolved

Hi,

I am able to get the SQL prompt. but everytime I login I need to execute the .profile and .bash_profile which I have created under /home. Can these two file be executed automatically when I login ?
 
Old 12-15-2010, 04:45 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Do you mean execute or source? If your shell is bash they should be sourced automatically. What is the shell for your user in /etc/passwd?
 
Old 12-15-2010, 04:52 AM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi,

referring to bash's manpage the name of the file in /home should be .bashrc instead of .bash_profile. The .bash_profile is the same as .profile and only sourced when bash is executed as a login-shell.

Markus
 
Old 12-15-2010, 05:13 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
AFAIK login must be done, including when logging in to a GUI desktop so ~/.bash_profile is always run. On starting a terminal emulator in the desktop an "interactive non-login" shell is started and so ~/.bashrc is run. If the OP followed advice given earlier in the thread then ~/.bashrc is run from ~/.bash_profile so all the bases should be covered.
 
Old 12-15-2010, 05:46 AM   #11
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi catkin,

ok, you're right, it should be sourced anyway. But at least having a ~/.profile and a ~/.bash_profile is redundant since both are sourced under the same circumstances, namely when bash is the login-shell.

Markus
 
Old 12-15-2010, 05:49 AM   #12
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
The file is .profile in Ubuntu, not .bash_profile. That's probably why you're having problems looking for the file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to create .bash_profile on slackware 13.1 as host basheer Linux From Scratch 3 07-07-2010 09:13 AM
can't find .bash_profile in Ubuntu 9.04 mikeyd1985 Linux - Newbie 10 10-08-2009 07:43 PM
Can't find my .bash_profile Allanitto Newbee Slackware - Installation 10 05-28-2009 07:57 PM
Cnt Find .bash_profile minky81 Linux - General 4 09-13-2007 06:05 AM
Cnt Find .bash_profile minky81 Linux - Newbie 1 09-12-2007 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration