Newbie questions about HOME directory files


 
Thread Tools Search this Thread
Operating Systems Solaris Newbie questions about HOME directory files
# 1  
Old 08-24-2009
Newbie questions about HOME directory files

Hi,

I am newbie to Solaris and system administration in general, and I have a couple of questions about files in my HOME directory.

When I perform ls -la, I get the following list of files:

Code:
drwxr-xr-x   7 XXXYYY staff         17 Aug 24 07:31 .
drwxr-xr-x   7 root     root           7 Jul 31 10:13 ..
-rw-------   1 XXXYYY staff       5145 Aug 23 12:44 .bash_history
-rw-r--r--   1 XXXYYY staff         68 Aug  1 10:59 .bash_login
-rw-r--r--   1 XXXYYY staff        280 Jul 31 10:13 .bashrc
drwxr-xr-x   6 XXXYYY staff         10 Aug 23 06:51 .hudson
drwxr-xr-x   3 XXXYYY staff          3 Aug  1 11:15 .m2
-rw-r--r--   1 XXXYYY staff        611 Jul 31 10:13 .profile
drwx------   2 XXXYYY staff          3 Jul 31 10:20 .ssh
drwx------   3 XXXYYY staff          3 Jul 31 14:40 .sunw
...
-rw-r--r--   1 XXXYYY staff       1039 Jul 31 10:13 local.cshrc
-rw-r--r--   1 XXXYYY staff        988 Jul 31 10:13 local.login
-rw-r--r--   1 XXXYYY staff       1002 Jul 31 10:13 local.profile

This week-end, I found out that I could not access 'svcadm' may be because my path was missing /usr/sbin/. I am getting the bash shell when I log in (echo $SHELL returns /usr/bin/bash).

I have been doing some reading on the Internet and it seems like:

i) local.cshrc is the shell start-up initialization file for the C shell, correct? If yes, it is not executed because I am under bash, correct?

ii) local.login is the login initialization file for the C shell, correct? If yes, it is not executed because I am under bash, correct?

iii) local.profile is the shell start-up initialization for the Bourne and Korn shells, correct? If yes, it is not executed because I am under bash, correct?

iv) What is the '.profile' file exactly? In my case, it exports a couple of variables and defines the default prompt. Is this file executed when I log in?

v) What is the '.bashrc' file exactly? It define the default prompt in my case. Is this file executed when I log in?

vi) '.bash_login' is a file I had to create as part of installation instructions for Maven. It exports the Maven path and adds it to the PATH variable. This file is obviously executed when I log in, because without it, I cannot run Maven from anywhere.

My question is: is there a way to export those variables for everyone who logs in? If yes, how should I proceed?

vii) '.bash_history' contains the list of commands I have been using recently. I have no questions about it.

viii) When I echo $PATH, I get

Code:
/usr/local/maven/bin:/usr/bin

which fits perfectly with what I am doing in .bash_login. It seems that only .bash_login is executed when I am logging in? Is this correct? Or are other default files executed too?

Thanks,

JVerstry

---------- Post updated at 07:24 PM ---------- Previous update was at 05:28 PM ----------

I have found a link (Bash env settings problems - comp.unix.solaris | Google Groups) which helped me answering some of my question. I have also performed a couple of tests.

/etc/profile is first executed, then .bash_login.

.profile is not executed, because .bash_login exists and is readable.

Since my .profile file contains:

Code:
export PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin

this explains why I could not access svcadm.

JVerstry
# 2  
Old 08-25-2009
No,

for svcadm you have to be root.
Profile is executed every time you log in.

cu
lowbyte
# 3  
Old 08-25-2009
I was/am root. Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove empty files in home directory

how to remove empty files tried below command its remove only zero bytes not empty file which is greater then zero byte. for x in * do if then rm $x fi done (8 Replies)
Discussion started by: Kalia
8 Replies

2. Solaris

what is the use of each login related files present in users home directory

# ls -l total 10 -rw-r--r-- 1 dummy2 other 140 Jun 19 21:37 local.cshrc -rw-r--r-- 1 dummy2 other 136 Jun 19 21:37 local.cshrc~ -rw-r--r-- 1 dummy2 other 157 Jun 19 21:37 local.login -rw-r--r-- 1 dummy2 other 178 Jun 19 21:37 local.profile... (6 Replies)
Discussion started by: chidori
6 Replies

3. Shell Programming and Scripting

users who have un-sanctioned(forbidden) files in their home directory.

Hello guys, I have to create a sh script which return users who have un-sanctioned(forbidden) files in their home directory. I tried to do: #!/bin/sh -x SHADOW_FILE="/etc/shadow" PASSWORD_FILE="/etc/passwd" for i in `grep -v '^+' $PASSWORD_FILE | cut -d: -f1,6` do username=`echo... (6 Replies)
Discussion started by: catalint
6 Replies

4. UNIX for Advanced & Expert Users

cksum for all files in home directory

I know i can run cksum <filename> . However, how i can run cksum on all the files and directories in the $HOME ?? (SUNOS) (4 Replies)
Discussion started by: moe458
4 Replies

5. Shell Programming and Scripting

help with removing files from home directory

hey there folks! I cant figure out, for the life of me, how to procede in removing alll the files in my home directory that are not owned by me. would i have to list them, but after that what do i do. or is there some way I am not aware of. my employer heard i could script in unix, but i havent... (3 Replies)
Discussion started by: Ginkosu
3 Replies

6. Shell Programming and Scripting

Find recently updated files in home directory

Is there a shell command that will allow me to list index files in the /home directory for all users on a server that have been updated within the past 24 hours? (e.g. index.htm .html .php in/home/user1/public_html /home/user2/public_html /home/user3/public_html etc ) (2 Replies)
Discussion started by: Kain
2 Replies

7. Cybersecurity

Strange files keep appearing in my home directory

Hi everyone, really strange files keep appearing in my home directory. I have absolutely no idea where they come from and I'm a little concerned that they could come from some kind of malware activity or Firefox exploit. I searched Google for parts of the file names but without a result. The... (6 Replies)
Discussion started by: schallstrom
6 Replies

8. Linux

Questions of a newbie

I have been an apple customer for years now, and am not satisfied with the direction that they are going. So I just ordered my first PC notebook the other day. I have no desire to use windows, however with microsoft's hold on the market, I feel that I may have a hard time doing this. I want to... (2 Replies)
Discussion started by: Brycemb16
2 Replies
Login or Register to Ask a Question