[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Files Reference

profile File Format

Purpose

Sets the user environment at login time.

Description

The $HOME/.profile file contains commands that the system executes when you log in. The .profile also provides variable profile assignments that the system sets and exports into the environment. The /etc/profile file contains commands run by all users at login.

After the login program adds the LOGNAME (login name) and HOME (login directory) variables to the environment, the commands in the $HOME/.profile file are executed, if the file is present. The .profile file contains the individual user profile that overrides the variables set in the profile file and customizes the user-environment profile variables set in the /etc/profile file. The .profile file is often used to set exported environment variables and terminal modes. The person who customizes the system can use the mkuser command to set default .profile files in each user home directory. Users can tailor their environment as desired by modifying their .profile file.

Note
The $HOME/.profile file is used to set environments for the Bourne and Korn shells. An equivalent environment for the C shell is the $HOME/.cshrc file.

Examples

The following example is typical of an /etc/profile file:

#Set file creation mask unmask 022
#Tell me when new mail arrives
MAIL=/usr/mail/$LOGNAME
#Add my /bin directory to the shell 
search sequence
PATH=/usr/bin:/usr/sbin:/etc::
#Set terminal type
TERM=lft
#Make some environment variables global
export MAIL PATH TERM

Files

/etc/profile Contains profile variables.

Related Information

The bsh command, csh command, env command, login command, mail command, mkuser command, ksh command, stty command, su command.

The Profiles Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices discusses profiles and how they can be modified for individual needs.

The Shells Overview in AIX 5L Version 5.2 System User's Guide: Operating System and Devices describes what shells are, the different types, and how they affect the way commands are interpreted.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]