欢迎使用CSDN-markdown编辑器

来源:互联网 发布:淘宝客服专用语言 编辑:程序博客网 时间:2024/06/02 06:37

/etc/profile 对于全部用户有效
~/.bashrc 对当前用户有效
Ubuntu文件中,用户目录下不存在.bash_profile文件,如果新建该文件并将环境变量添加到该文件中

vim .bash_profileexport PATH=$PATH:/home/gaoyang/rpi-src/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

加载.bash_profile

    source ~/.bash_profile

secureCRT登录时发现ls命令后,文件无色彩区别。
网上搜索

Linux中profile、bashrc、~/.bash_profile、~/.bashrc、~/.bash_profile文件的介绍

后查看/.profile文件的描述(Ubuntu)

# ~/.profile: executed by the command interpreter for login shells.**# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login# exists.**# see /usr/share/doc/bash/examples/startup-files for examples.# the files are located in the bash-doc package.# the default umask is set in /etc/profile; for setting the umask# for ssh logins, install and configure the libpam-umask package.#umask 022# if running bashif [ -n "$BASH_VERSION" ]; then    # include .bashrc if it exists    if [ -f "$HOME/.bashrc" ]; then        . "$HOME/.bashrc"    fifi# set PATH so it includes user's private bin if it existsif [ -d "$HOME/bin" ] ; then    PATH="$HOME/bin:$PATH"fi

如果存在.bashrc_profile文件,将不会调用.profile文件,最终导致使用secureCRT登录的界面,没有色彩区分(未调用.bashrc文件,该文件中有对颜色的设置)。
于是将环境变量添加到~/.profile文件中:

export PATH=$PATH:/home/gaoyang/rpi-src/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

加载.profile文件:

    source ~/.profile

问题解决。

http://blog.csdn.net/gatieme/article/details/45064705

0 0
原创粉丝点击