bash - 我将路径添加到 ~/.bashrc 和/root/.bashrc,但是 "sudo adb"仍然报告 "command not found"?

标签 bash ubuntu ubuntu-10.04

<分区>


想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。

关闭 11 年前

我在 ~/.bashrc/root/.bashrc 中添加了 PATH,但是 sudo adb仍然报告“找不到命令”?

我也重新启动了。

所以我需要一种方法让 sudo.bashrc 与我用户的 .bashrc 同步?

路径是正确的,因为我可以从我的用户运行,而不是 sudo:

PATH=~/android-sdks/tools:$PATH
PATH=~/android-sdks/platform-tools:$PATH

最佳答案

哦,我明白了:

sudo -E adb

人须藤:

   -E          The -E (preserve environment) option will override the env_reset option in
               sudoers(5)).  It is only available when either the matching command has the SETENV
               tag or the setenv option is set in sudoers(5).

关于bash - 我将路径添加到 ~/.bashrc 和/root/.bashrc,但是 "sudo adb"仍然报告 "command not found"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8549368/

上一篇:ruby-on-rails - 将网页或 nokogiri 文档保存到数据库字段

下一篇:python - Ubuntu Server 中的 Selelum Headless,小错误 "The browser seems to have exited before we could connect"

相关文章:

Python 子进程语法无效

php - 从 PHP 执行 Bash 脚本

bash - 如何在 unix 终端模拟器中使用脚本命令?

ubuntu - 每 3 小时 cron 作业和每 3+1 小时 cron 作业

java - 如何在 Ubuntu 中编译和执行这个 JAVA 应用程序?

android - 如何在 Ubuntu 上使用 openjdk 构建 android 项目?

python - 与 django cms 中的 views.py 文件相关的查询

ruby-on-rails - 如何让crontab成功启动WEBrick

c - fork之后,父子进程是否共享pipe创建的文件描述符?

linux - 从文件中读取值并将它们与另一个值进行比较的 Shell 脚本