LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .profile .login (https://www.linuxquestions.org/questions/linux-newbie-8/profile-login-31918/)

albean 10-04-2002 03:15 PM

.profile .login
 
Hi all,

Here are a few more newbie questions (I can't want to graduate out of the newbie
category and start answering other people's questions :) )

Background: I'm installing a program and it tells me that I need to put some
environment variables in the .profile or .login depending on which shell I'm
using.

Q1: I'm able to tell that I'm using bash so I will need to edit the .login file
but...
I can't find one. In what directory should I create it if it does not exist?
(or, as i suspect, it exists but it is hidden see Q2)

Q2: I'm using rh 7.3 with KDE. When I open Konsole and type printenv I get back
a whole list of variables. This leads me to believe that .login does exist but
it must be hidden (right?) if so where is it and how can i unhide it?

d3funct 10-04-2002 03:28 PM

A1: The .profile in the bash-shell is called .bash_profile. The .login under bash is called .bashrc

A2: In order to see "hidden files" use the command "ls -a" or "ls -la" for a detailed listing.

You can put the variables in either .bash_profile or .bashrc, but usually they go in .bashrc.

Use the syntax "export VARIABLE_NAME='variable definition' to have the variable exported to your environment. If you do not use the word "export" in front of the variable the variable while defined will not be useable in the environment until exported. To verify the variable is exported do "echo $VARIABLE_NAME" and it should return the value you defined it as.

albean 10-04-2002 04:06 PM

Thanks d3funct,

I found the .bashrc and the .bash_profile files. The only thing is they don't contain much and neither contains any of the environ variables that i see when i type printenv. Is there some script that is run upon login? (I looked of a .login but did not find on.)

Thanks

Also, awhile ago I saw somebody search a hard drive for a certian file. He used ls and he "piped" it to grep (i think it was grep). So when the command was executed it only showed that file and the directory it was in. If someone knows what I'm talking about could you give me the sysntax for this command?

Thanks

sandy 10-04-2002 08:50 PM

Quote:

Originally posted by albean
I found the .bashrc and the .bash_profile files. The only thing is they don't contain much and neither contains any of the environ variables that i see when i type printenv. Is there some script that is run upon login? (I looked of a .login but did not find on.)
yes there's a file called /etc/profile that's run upon the logon.It sets most of the variables . and the remaining are set by bash itself ( ie BASH_ENV, HISTFILE etc).

Quote:

Also, awhile ago I saw somebody search a hard drive for a certian file. He used ls and he "piped" it to grep (i think it was grep). So when the command was executed it only showed that file and the directory it was in. If someone knows what I'm talking about could you give me the sysntax for this command?
The commands to find a file in the harddrive are find,locate,kfind( i dont remember the last name).Or If u are in search to the very command that your friend used then I think it may be ls -R <directory>|grep <filename>

sandy 10-04-2002 08:51 PM

[snipped]


All times are GMT -5. The time now is 09:18 AM.