Tag: environment variables

通过更新〜/ .profile而不工作来添加自定义路径

我通过添加以下内容来修改我的〜/ .profile文件: PATH=”/user/share/android-sdk-linux/tools:$PATH” 然后我注销并再次登录,但路径未添加到$ PATH环境变量中。 我正在检查终端: echo $PATH /usr/share/android-sdk-linux/tools:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.7.0_17/bin 请指教 编辑 我甚至尝试过: PATH=$PATH:/usr/share/android-sdk-linux/tools EXPORT PATH 这里也没有运气。 编辑2 〜/ .profile文件: # ~/.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 […]

“sudo pip”与普通的“pip”不同

当我执行 which pip3 它指向 /usr/…/anaconda3/bin/pip3 但是,当我跑 sudo which pip3 结果是 /usr/bin/pip3 这个问题来自哪里,我如何实现sudo pip也指向/usr/…/anaconda3/bin/pip3 ?

打开终端时为什么没有.profile来源?

刚刚安装了Ubuntu 14.04.1 LTS。 根据.profile, # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash, if ~/.bash_profile or ~/.bash_login exists. 没有〜/ .bash_profile或〜/ .bash_login。 打开终端时似乎没有源.profile。 打开终端时为什么不来源.profile? 如果没有来源,为什么.profile在那里? 如何知道/控制新终端打开时的来源? 打开新终端时,它是否会“登录”? 在我的路径中添加$ HOME / bin的好地方在哪里? .bashrc中? 这会导致问题,因为.profile具有相同的代码吗?

永久PATH变量

如何将此/media/De Soft/mongodb/bin PATH变量永久化? 每个人都说export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv具体取决于你的shell。 我不知道〜/ .profile,或.bashrc或.zshenv是什么。 他们实际上做了什么? 我将如何添加export PATH=$PATH:my/path到我的.profile / .bashrc / .zshenv? 我使用64位Ununtu 14.04 LTS和默认终端。 我是Linux的新手。

如何为Android设备配置ADB访问?

我正在使用Ubuntu 12.10并且我安装了Android SDK,在我的用户.bashrc设置它的路径并且它可以工作。 问题是我的手机需要根据权限运行adb,但是使用sudo运行adb我收到以下错误: sudo:adb:命令未找到 我试图简单地使用sudo -E adb start-server ,但它不起作用。 试图将导出路径行添加到/root/.bashrc并且(在意识到它没有帮助之后)到/etc/bash.bashrc 。 我记得我可以在我的Arch Linux上设置它,但我想现在我的问题与Ubuntu root帐户有关,表现不像我期望的那样。 我不明白的是以下内容: 这些不起作用: martin@alyx:~$ sudo adb devices sudo: adb: command not found 这样做(输入完整路径): martin@alyx:~$ sudo /opt/android-sdk-linux/platform-tools/adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached CM7-Blade device 这不起作用(使用-E和sudo): martin@alyx:~$ […]

打开终端时为什么〜/ .bash_profile没有获取来源?

问题 我有一个Ubuntu 11.04虚拟机,我想建立我的Java开发环境。 我做了如下 sudo apt-get install openjdk-6-jdk 在〜/ .bash_profile中添加了以下条目 export JAVA_HOME=/usr/lib/jvm/java-6-openjdk export PATH=$PATH:$JAVA_HOME/bin 保存更改并退出 再次打开终端并输入以下内容 echo $JAVA_HOME (blank) echo $PATH (displayed, but not the JAVA_HOME value) 没有发生任何事情,比如JAVA_HOME的导出和它对PATH的补充从未完成。 解 我不得不去〜/ .bashrc并在文件末尾添加以下条目 #Source bash_profile to set JAVA_HOME and add it to the PATH because for some reason is not being picked up . ~/.bash_profile 问题 为什么我必须这样做? […]