ENV

From ElectroDragon Wiki
Revision as of 22:34, 31 January 2020 by Chao (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

/etc/profile

此文件为系统的每个用户设置环境信息。当用户登录时,该文件被执行一次,并从 /etc/profile.d 目录的配置文件中搜集shell 的设置。一般用于设置所有用户使用的全局变量。

For all users: /etc/bashrc or /etc/bash.bashrc

  • For ubuntu or Lubuntu -> /etc/bash.bashrc

2) 修改/etc/bashrc

当 bash shell 被打开时,该文件被读取。也就是说,每次新打开一个终端 shell,该文件就会被读取。
此外,在不同的操作系统中,这个文件可能是不同的,比如在Ubuntu系统中,一般是:/etc/bash.bashrc

mipsel-openwrt-linux-gcc

  • nano /etc/bash.bashrc

export PATH=/opt/OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin:$PATH export STAGING_DIR=/your_openwrt_path/staging_dir

  • source /etc/bash.bashrc
  • check mipsel-openwrt-linux-gcc -v

CLI: env

  • Check path

Set Proxy

  • /etc/profile
PROXY_HOST=127.0.0.1
export all_proxy=http://$PROXY_HOST:8118
export ftp_proxy=http://$PROXY_HOST:8118
export http_proxy=http://$PROXY_HOST:8118
export https_proxy=http://$PROXY_HOST:8118
alias gfw="curl -sL www.pornhub.com"
  • source /etc/profile