bash - Git bash | bash : sudo: command not found (and others)

标签 bash git-bash sudo apt su

目标:让诗歌发挥作用。

Windows 10 上使用 Git BashWSL 2

我的 Anaconda3 和 Git 正在运行。

pip install bash 有效,但没有帮助。


Git bash :

(base)
HDS+dabell@PF2DCSXD MINGW64 ~
$ sudo -s
bash: sudo: command not found
(base)
HDS+dabell@PF2DCSXD MINGW64 ~
$ su -
bash: su: command not found
(base)
HDS+dabell@PF2DCSXD MINGW64 ~
$ apt update
bash: apt: command not found
(base)
HDS+dabell@PF2DCSXD MINGW64 ~
$ apt install sudo -y
bash: apt: command not found
(base)
HDS+dabell@PF2DCSXD MINGW64 ~
$ cat ~/.bashrc
. /c/Users/dabell/Anaconda3/etc/profile.d/conda.sh
(base)

这些命令适用于 WSL 2。

最佳答案

正如 @tkausl 所说,Git Bash 不附带此类命令

我还在 Stack Overflow 上发现了类似的帖子,top answer表述相同。

关于bash - Git bash | bash : sudo: command not found (and others),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72798227/

相关文章:

windows - 在 bash 脚本结束时保持终端打开

bash - Unix,使用 awk 删除第一列

bash - 带有 SSH 的 git clone 只能在 Git Bash 中工作,不能在 Windows CMD 上工作

ubuntu - 在 Linux 中,如何在 Qt Creator 中添加一个使用 su 权限的构建步骤,而不会在构建时尝试输入错误的密码?

sudo - 编号 : cannot find name for group ID 197121

regex - 如何在 `/` 之后获取此字符串的一部分?

bash - 逐行读取文件时读取bash脚本中文件的最后一行

python-3.x - Python 通过 'Git Bash' 打印 Unicode 字符串得到 'UnicodeEncodeError'

git - 尝试批量推送大量提交

linux - sudo 还是不 sudo?