1. View variables
View all variable set commands , including custom variables
View system variables env command
2. Define global variables
export variable name = variable value // you can define global variables
Note: A global variable is defined in the child bash, which takes effect in the next-order child bash, but does not take effect in the parent bash.
3. Variable related files
The profile and bashrc under etc are global configurations.
/etc/profile //profile is loaded at login and will call bashrc.
/etc/bashrc //The bashrc file is loaded when logging in or executing a shell script.
The profile and bashrc in the home directory are the current user's configuration files.
~/.profile //Same as above
~/.bashrc // same as above
~/.history //The file that records the history command
~/.logout //Command executed when logging out