Getting started with the shell-system and user profiles

Source: Internet
Author: User

Variables are divided into system variables and user-defined variables, and their profiles are of course divided into system environment variable configuration file and user environment variable control file.

1. Specify the configuration file for the environment variable

[Email protected] 111]# Vim/etc/profile

We recommend that you create a *.sh file under/ETC/PROFILE.D to modify

2. Variables in the configuration file that modify the global parameters

[Email protected] 111]# vim/etc/profile.d/path.sh

#!/bin/bash

Export path= $PATH:/tmp/:/date/bin/
~
~

: Wq

[[email protected] 111]# source/etc/profile//Reset Effective

[[email protected] 111]# echo $PATH view

3. Modify the system's bash system configuration file

The location of the directory is

[Email protected] 111]# VIM/ETC/BASHRC

Modify the PS1 variable inside the BASHRC

[Email protected] 111]# echo $PS 1
[\[email protected]\h \w]\$
[[email protected] 111]# ps1= ' [\[email protected]\h\t \w]\$ '
[[Email protected]:51:02/111]#

Change back is to change ' t ' W ' to ' W '

[Email protected]:51:02/111]# ps1= ' [\[email protected]\h \w]\$ '
[Email protected] 111]# echo $PS 1
[\[email protected]\h \w]\$

Change the Umask value

[Email protected] 111]# vim/etc/profile.d/umask.sh

umask 0012

~
~

: Wq

[Email protected] 111]# Source/etc/profile

[Email protected] 111]# umask
0012

And then change back to 0022 as above, reset takes effect. View Umask

//////////////////////////////////////////////////////////////////////////////////////////

The user modifies the environment variable profile to switch to that user and then modifies

Switch users first

[[Email protected] 111]# CD
[Email protected] ~]# ls-a.

. bash_profile

User-defined environment variables

. BASHRC

User-defined aliases

///////////////////////////////////////////////////////////////////////////////////////////////

Summary: vim/etc/profile.d/**.sh variables that modify global parameters Source/etc/profile variable restart takes effect

User variable switch to user under Modify

Getting started with the shell-system and user profiles

Related Article

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.