linux - Ubuntu 16.04 "Bash: Alias: X: not found"

标签 linux bash ubuntu alias

我正在尝试创建别名作为我作业的一部分。 按照有关如何在 Linux 上创建别名的指南,我这样做了:

  1. 通过添加“alias pwgen="pwgen -y -1 12""(当然没有外引号)来编辑 ~/.bashrc,因此编写 pwgen 将给出一个 12 个字符的密码,其中至少有 1 个特殊字符。<
  2. 做了“source ~/.bashrc”

但这就是问题所在,在 source 命令之后终端显示:

Bash: Alias: -y: not found
Bash: Alias: -1: not found
Bash: Alias: 12: not found

我试过只写

alias pwgen="pwgen -y -1 12"

在基本的 Linux 终端中,但结果是一样的。

我错过了什么或做错了什么?

最佳答案

你的命令在我的 linux 机器上就像一个魅力,所以问题可能来自其他地方。尝试使用这样的简单引用:

alias pwgen='pwgen -y -1 12'

关于linux - Ubuntu 16.04 "Bash: Alias: X: not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42674907/

相关文章:

bash - 将完整环境导出到 GNU Parallel

bash - 如何调用ssh,使其仅使用身份文件

linux - ld 在错误的路径中搜索,并搜索错误的库

java - Tomcat APR native 库*甚至*在存在并配置时未加载

Linux:如何检测进程的启动方式

linux - 如何将 sed 与模式文件和 sed 一起使用

bash - 通过 sed 有条件地通过管道输出

linux - 命令未在 Linux EC2 实例启动时运行

python - 设置 TensorFlow GPU 支持的问题

linux - Makefile:649: *** 缺少分隔符。停止