查看环境变量 echo

[email protected][/usr/bosch]$echo $ZSMART_HOME
/ztesoft/bosch

设置用户级环境变量

到用户目录下查看文件列表:

[email protected][/usr/bosch]$ls -al
total 20
drwx------.  2 bosch bosch  97 Dec 28 21:43 .
drwxr-xr-x. 15 root  root  180 Dec 28 16:32 ..
-rw-------.  1 bosch bosch 221 Dec 29 11:23 .bash_history
-rw-r--r--.  1 bosch bosch  18 Aug  3  2016 .bash_logout
-rw-r--r--.  1 bosch bosch 226 Dec 29 11:23 .bash_profile
-rw-r--r--.  1 bosch bosch 231 Aug  3  2016 .bashrc
-rw-r--r--.  1 bosch bosch 172 Nov  6  2016 .kshrc
[email protected][/usr/bosch]$

用vi在.bash_profile文件中增加环境变量

[email protected][/usr/bosch]$vi .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export ZSMART_HOME=/ztesoft/bosch

~
~
~

需要修改则输入 I,即切换到插入状态了。
修改完,需要保存退出,先按ESC,则退出输入状态,再按:,即表示等待输入命令,

W:write,写入

Q:quit,退出

输入wq再输入Enter就保存退出了。

linux进入退出VIM编辑器:https://www.cnblogs.com/crazylqy/p/5649860.html

磁盘空间满了 No space left on device

results matching ""

    No results matching ""