About profile files

Source: Internet
Author: User

The login shell executes two special files,

One is: \etc\profile, this file is set by the system administrator, usually do some such as check whether there is mail, set the default file to create a mask, to some table to go everywhere variable assignment, already any administrator wants to execute the command every time the user logs on.
The 2nd automatically executed file is the. profile file in the host directory. When you get an account, the system administrator will give a default. profile file.
Look at what it's like now:
$cat $HOME/.profile
Path= "Bin:/usr/bin:usr/lbin:.:"
Export PATH
$
What you see here is a small. profile file, which simply sets the path and then exports it. You can modify your. profile file to include any commands that you want to execute every time you log on. Settings can place commands in their own. profile files, overwriting/etc/profile settings (usually environment variables).


Note that/etc/profiles and. Profile are executed by a login shell,
$./etc/profile
$. . Profile
$

This means that their changes to the environment will be preserved after the program is executed.

After you change the user with the SU command, you need to execute the user's. profile file. It's like doing an initialization.

Su-spsausr

. /db2/ldid111/sqllib/db2profile

About profile files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.