如何创建包含shell命令的别名

时间:2018-04-10 17:02:33

标签: bash shell command alias

如何创建一个名为'cpu'的别名来运行此shell命令 sysctl -n machdep.cpu.brand_string

我用过:

alias cpu = sysctl -n machdep.cpu.brand_string

我得到的所有内容如下:

-bash: alias: cpu: not found
-bash: alias: =: not found
-bash: alias: sysctl: not found
-bash: alias: -n: not found
-bash: alias: machdep.cpu.brand_string: not found

1 个答案:

答案 0 :(得分:1)

摆脱accept=".txt,.rtf,.pdf,.doc,.docx,.zip" 周围的空格并用引号括起命令。

=