Get the App
SLTechnology News&Howtos  ›  Network Security  › 

System and user environment variable profiles

Shulou Source: shulou.com Published: 2022-06-01 06:04:56 10月04日 Update

/ etc/profile: this file presets several important variables, such as PATH, USER, LOGNAME, MAIL, INPUTRC, HOSTNAME, HISTSIZE, umask, and so on.

/ etc/bashrc: this file mainly presets umask and PS1. This PSI is the previous string of characters when we type the command. For example, the default PSI for CentOS root users is [root@GeorgeLinux ~] #. Take a look at the value of PS1:

\ u is the user,\ h hostname,\ W is the current directory,\ $is the "#", and if it is an ordinary user, it is displayed as "$".

In addition to these two system-level configuration files, there are several such hidden files in each user's home directory:

.bash _ profile: the file name that defines the user's personalization path and environment variables. Each user can use this file to enter shell information dedicated to their own use, and the file is executed only once when the user logs in.

.bashrc: this file contains bash information specific to your shell, which is read when you log in and every time you open a new shell. For example, nikeyi8 writes user-defined alias or custom variables to this file.

.bash _ history: used to record the history of commands.

.bash _ logout: this file is executed when you exit shell. You can put some clean-up work in this file.

Tags: File user that is variable information command directory login environment system configuration normal important two personal host history name character level Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Microsoft Shulou Information Xiaomi