I installed some packages like brew via terminal which altered $PATH. Now iTerm's $PATH is not same as terminal, causing CLI commands like brew not working on iTerm.

echo $PATH on terminal gives:


echo $PATH on iTerm gives:


I created a $PATH in .bashrc file but later deleted it and restarted system.

without the presence of .bashrc and .bash_profile no user-defined config should affect the shells.

Any ideas?

closed as off-topic by muru, Anthony Geoghegan, Satō Katsura, Jeff Schaller, Archemar Nov 15 '17 at 12:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – muru, Anthony Geoghegan, Satō Katsura, Jeff Schaller, Archemar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Can you edit with more info? What version of macOS is this? In either Terminal or iTerm (it'll be the same), what is the output of launchctl getenv PATH, cat /etc/paths, ls -lF /etc/paths.d, cat /etc/profile, cat /etc/bashrc, cat /etc/bash.bashrc, ls -ldF ~/.*bash*, cat ~/.bashrc, cat ~/.bash_profile, cat ~/.bash_login and cat ~/.profile? Errors are expected; please include them. But please show output of these commands in both Terminal and iTerm, as the results may differ: echo "$-", shopt login_shell, echo "$0", echo "$BASH" and echo "$BASH_VERSION". – Eliah Kagan Nov 15 '17 at 6:43
  • 1
    @EliahKagan thanks for the help. but i just removed Iterm and installed again since it a recent install it worked – Sagi_Avinash_Varma Nov 15 '17 at 7:33