You can't expect zsh to be able to run the bash commands in your .bashrc, so you should convert it into a new .zshrc instead of trying to run .bashrc from .zshrc or copying the former into the latter. If you want a common shell initialization file for all your shells; use .profile (and remove .bashrc and .zshrc ). It's sourced by all POSIX shells.
The reason why terminal can't find your .bash_profile is because you are using zsh as your default shell, not bash. Zsh is a newer and it has its own configuration file called .zshrc. If you want to update your zsh settings, you need to edit the .zshrc file instead of the .bash_profile file. To help terminal locate the file, you can use the
In macOS 10.15 or beyond (Catalina, Big Sur, Monterey), you need to edit the .zshrc file instead of the .bashrc or .bash_profile file. In the process, you may face a big problem: you cannot find the .bashrc file on your Mac. Mac users only assuming you installed nvm prior, and npm correctly (step-by-step guide below on how to install it: install nvm for Mac users). you need to: Find the '.zshrc' file: Open Terminal. Type open ~ to access your home directory. Press Cmd + Shift + . to show the hidden files in Finder. Locate the .zshrc. Edit the '.zshrc' file: The answer is simple, almost evident in the question. Here's why: The shell zsh is not bash, it is a different shell. zsh will not use the default files built for bash: .bashrc or .bash_profile. These two files are startup configuration files for bash. zsh has its own startup configuration files. You can find out more about them here on the zsh Aliases in a script file disappear after the script has been run (unless the script is called by another script, then the calling script has the new alias definition). Aliases executed in startup files like "~/.zshrc" etc. aren't used within script files. /etc/zshenv # Read for every shell ~/.zshenv # Read for every shell except ones started with -f /etc/zprofile # Global config for login shells, read before zshrc ~/.zprofile # User config for login shells /etc/zshrc # Global config for interactive shells ~/.zshrc # User config for interactive shells /etc/zlogin # Global config for login shells
\n how to find zshrc file in mac
How to locate the system level .zshrc file? You can find the system level .zshrc file where all the system's configuration files live i.e. the /etc. Open Mac Terminal, Move to /etc directory: cd /etc. You will find a zshrc file here (this is not a hidden file), Open this file using nano or vim editor: vi zshrc. 2. When the file opens, add the environment variable in a new line: export VARIABLE_NAME=VARIABLE_VALUE. 3. Save the file and close the editor::wq. 4. Reinitialize the configuration file to apply the changes to the current session. Run the following command: source ~/.zshrc. Check if the variable exists by running echo or printenv: 1FLpaQ.
  • ene35xyeid.pages.dev/384
  • ene35xyeid.pages.dev/491
  • ene35xyeid.pages.dev/270
  • ene35xyeid.pages.dev/390
  • ene35xyeid.pages.dev/278
  • ene35xyeid.pages.dev/480
  • ene35xyeid.pages.dev/142
  • ene35xyeid.pages.dev/484
  • how to find zshrc file in mac