【问题标题】:Is it possible to set environment variables for user in linux?是否可以在linux中为用户设置环境变量?
【发布时间】:2011-04-06 08:41:06
【问题描述】:

我有windows box,也有linux box,我有我的帐户/home/my_username。每次连接到 linux 时,我都在 windows (cygwin ssh.exe) 中使用 ssh 客户端。但是每次登录后我都会运行一些脚本来设置一些环境变量。所以问题是我可以为我的用户(不改变其他人)设置环境变量以不运行每次脚本吗?

【问题讨论】:

    标签: linux environment-variables


    【解决方案1】:

    通常你在你的 shell 中设置它.. 取决于你有什么:bash, sh, ... 例如在 /home/user/.bashrc 中添加你的东西,它将在登录后执行

    【讨论】:

      【解决方案2】:

      假设linux shell是bash,请参考http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files。 对于其他 shell,文件会有所不同。手册页还应该告诉您需要修改哪个文件。 男人

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-09-15
        • 1970-01-01
        • 1970-01-01
        • 2015-08-21
        • 2015-08-07
        • 2015-02-14
        • 1970-01-01
        相关资源
        最近更新 更多