-bash: dirname: command not found

I am finding the below line every time I open my terminal

-bash: dirname: command not found.

My current path is /usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/Users/jiayi/opt/anaconda3/bin:/bin:/usr/local/mysql/bin:.

How can I resolve this problem? I already tried export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" in order to change the path to default, but every time I open a new terminal, the path would go back to the messy one.

MacBook

Posted on May 18, 2020 11:07 PM

Reply

Similar questions

2 replies

May 20, 2020 11:41 PM in response to jiayi19

Check your "~/.bash_profile" file to see if the PATH environmental variable is being modified.


Using the "export" command in the Terminal window only affects child processes and does not affect any other Terminal windows you may open.


See these articles for some more information:

https://scriptingosx.com/2017/04/about-bash_profile-and-bashrc-on-macos/


https://scriptingosx.com/2017/04/on-bash-environment-variables/

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

-bash: dirname: command not found

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.