- Learning Linux Shell Scripting
- Ganesh Naik
- 228字
- 2021-06-25 22:02:55
Working with environment variables
Environmental variables are inherited by any subshells or child processes, for example, HOME, PATH. Every shell Terminal has a memory area called the environment. Shell keeps all details and settings in the environment. When we start a new Terminal or shell, this environment is created every time.
We can view the environment variables with the following command:
$ env
Or we can use this:
$ printenv
The output of the $ env command is as follows:
The list of environment variables will be quite extensive. I advise you to browse through the complete list. We can change the content of any of these environment variables.
Environmental variables are defined in a Terminal or shell. They will be available in any subshells or child shells created from the current shell Terminal. You will learn about these activities in the next few sections. You have already learned that every command in a shell creates a new subshell from the current shell.
The following is a brief summary of a few environmental variables:

Whenever any user logs in, the /etc/profile shell script is executed.
For every user, the .bash_profile Shell script is stored in the home folder. The complete path or location is /home/user_name/.profile.
Whenever a new Terminal is created, every new Terminal will execute script .bashrc, which is located in the home folder of every user.
- Clojure Data Analysis Cookbook
- Div+CSS 3.0網(wǎng)頁布局案例精粹
- Design for the Future
- 高性能混合信號ARM:ADuC7xxx原理與應(yīng)用開發(fā)
- 實時流計算系統(tǒng)設(shè)計與實現(xiàn)
- 圖解PLC控制系統(tǒng)梯形圖和語句表
- 精通數(shù)據(jù)科學算法
- Unity Multiplayer Games
- 液壓機智能故障診斷方法集成技術(shù)
- 精通LabVIEW程序設(shè)計
- Windows安全指南
- Machine Learning with Spark(Second Edition)
- 天才與算法:人腦與AI的數(shù)學思維
- 中小型網(wǎng)站建設(shè)與管理
- Windows Server 2012 Automation with PowerShell Cookbook