.bash-profile中的命令不起作用

时间:2010-11-15 18:46:16

标签: macos bash terminal

我在Mac Leopard上的主目录中的.bash_profile文件中添加了别名。例如,

alias preview = "open -a preview"
alias lsall = "ls -l"

当我尝试从命令行运行这些命令时,我收到command not found

的消息

知道我可能做错了什么吗?谢谢!

1 个答案:

答案 0 :(得分:3)

你只需要丢失=周围的空格,即

alias preview="open -a preview"
alias lsall="ls -l"

如果您希望在启动新shell时自动执行该文件,则还需要将文件命名为.bash_profile