man sh
INVOCATION
A login shell first reads commands from the
files /etc/profile and then .profile in a user's home directory, if they
exist. If the environment variable ENV is set on entry to a shell, or is
set in the .profile of a login shell, the shell then subjects its value
to parameter expansion and arithmetic expansion and reads commands from
the named file.
если у вас другой шелл, то читайте ман к нему, там все написано)
а так /etc/profile a потом ~/.profile