In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how to solve the problem of using iTerm terminal to configure aliases, which does not take effect after restart". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. below, please follow the editor's ideas slowly and deeply, together to study and learn "how to solve the problem of using iTerm terminals to configure aliases, and aliases do not take effect after restart".
Problem source
In MacOS, python is installed by default, and version 2.7
Python allows multiple python versions of the same system
Using the python command on the terminal opens python2.7 by default. To use python3, you need to use the python3 command. In order to use the python command directly to open python3, you need to set the alias alias.
problem
After configuring the environment variable in bash_profile, configure the alias alias
Cause problem: the alias will not take effect until bash_profile is executed on the terminal, and the command will expire every time iTerm2 is restarted
Source ~ / .bash_profile solution
Write the alias alias configuration in bash_profile in zshrc, which solves the problem of alias alias invalidation after iTerm2 restart
Vi ~ / .zshrc principle
In fact, this principle is equivalent to: only when the terminal executes bash_profile:source ~ / .bash_profile every time it is rebooted, the alias will take effect.
Because once iTerm2 is started, the zshrc file will be executed automatically
The configurations in zshrc are all global configurations
Be careful!
Note the version of shell used:
Zsh corresponds to zshrc.
Bash corresponds to basic.
When solving the problem of the failure of the alias alias restart terminal, the online solution is to add configuration in bashrc. I tried without success.
Later, I suddenly thought of the zshrc file that I used before.
It turns out that when I configured oh-my-zsh, I replaced the terminal shell from bash to zsh, which solved the problem perfectly after using zshrc.
Thank you for your reading, the above is the content of "how to solve the problem of using iTerm terminal to configure aliases and the aliases do not take effect after restart". After the study of this article, I believe you have a deeper understanding of how to solve the problem of aliases configured using iTerm terminals and aliases that do not take effect after restart. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.