Tuesday, December 23, 2008

Unix User Profiles

I know that most you are aware of these. But i would like to reiterate them.

As the name conveys profiles are something where we have description of our own choices and so.
And in the same line Unix profiles are those where a unix user can have the default environment choices.

After the user logs in as a part of starting up the user's shell, two profile files are executed.
The first is the system default profile located at "/etc/profile", which is common for all the users and run by every user.Second one is the ".profile" in the user's home directory which is only run by the user who owns it.

The intention of these profile files is to set up the environment each user will need to use the system.

Before a logged-in user gets a shell prompt to start working, a robust profiles will usually display messages about the system. They will also setup $PATH so that the users can access basic UNIX System programs.

So if you want to set your own customised environment you can do it at $HOME/.profile. As the changes done here will effect only a particular user.

Go to user's home directory and look for the .profile file. Don't worry if you don't find one you can always create your own file.
Add the desired commands so as to have your own environment.
From the next login you can see the changes.

A typical user profile would look like:

$HOME/.profile

# envvars
export DISPLAY=localhost:0
export ENV=$HOME/.kshrc
export PATH=$HOME/bin:$HOME/tools:$PATH:/sbin/:/usr/local/bin/mh:$HOME/accounts/binexport
PRINTER=ljps
export SHELL=/bin/ksh
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp

# shell options
set -o bgnice
set -o noclobber
set -o notify
set -o trackall
set -o vi
set -o vi-tabcomplete

umask 077

trap '. $HOME/.sh_logout; exit' 0

No comments:

Post a Comment