I cannot get aliases to work correctly in my Terminal.app. I created a ".profile" file in my home directory (/Users/my_username) using:

touch ~/.profile

Then I opened this file using TextEdit and entered the following:

PS1="(\!) \w: "

alias rm=“rm -i”
alias cp=“cp -i”
alias mv=“mv -i”

The PS1 line works fine but every time I start up a new window in the Terminal.app it reads out the following:

-bash: alias: -i”: not found
-bash: alias: -i”: not found
-bash: alias: -i”: not found

I have read it may have to to with my .bashrc file but I have no idea where to find this and was under the impression that I could get aliases to work without editing that file.

What should I try next?

有帮助吗?

解决方案

Your problem is with the "smart quote" “ ” characters; replace those with the normal quote character ".

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top