每当我在Mac上的iTerm(或终端)中打开一个新窗口时,它会暂停一两秒钟,然后打印此消息:
-bash: alias: | grep -v 127.0.0.1: not found
fatal: Not a git repository (or any of the parent directories): .git
我很清楚,它正在每个新窗口上执行这个grep / git命令,但我无法弄清楚它的来源,也不知道如何让它停止。
我在哪里可以找到这个命令?
答案 0 :(得分:0)
在preferences -> profiles -> general
中,您可以从“开始时发送文本”字段中删除该命令。
这将在每次启动新shell时停止运行该命令。
答案 1 :(得分:0)
我也遇到了这个问题,但这不是这个特定的 bash 命令。我需要删除 .zshrc
文件中运行的一些命令。
为此,我运行了 vim 并删除了命令。你的可能看起来像:
# Run your /.zshrc file to confirm that it is the source of your error
source ~/.zshrc
# If it is, open it in vim
vim ~/.zshrc
# While in vim, you can search by hitting the forward-slash key "/" and then
# typing your search word. Navigate through results with the next key "n". Perhaps
# you could search for grep, which shouldn't occur often in your .zshrc file.
/grep
# Remove/fix the offending line