当前位置:网站首页>Questions about Mac terminal custom commands and Mysql command
Questions about Mac terminal custom commands and Mysql command
2022-08-08 20:32:00 【Do not forget the original intention z】
Mac Terminal Custom Commands
When entering the mac terminal, we often encounter some commands that are very complicated, and each time we need to enter more commands to achieve the effect, so there is a custom command function in the mac computer
Enter the mac terminalEnter:
vim ~/.bashrc After entering the interface, we can set custom commands.
First, you can press i to enter the editing mode. The custom command has a standard format which is
alias self-defined command = "input those commands before replacing"
For example, the way to enter the mysql database is rather cumbersome.Need /urs/loacl/mysql/bin/mysql -uroot -p to enter the database, so we can modify it to
alias gomysql = "urs/loacl/mysql/bin/mysql" After that we have to press esc to exit the editing, and thenPress: colon and wq to complete the editing and exit: wq
After exiting, use the command source ~/.bashrc to import the command just now, so that we can enter in the terminal:
gomysql -u root -p and then enter youYou can just get the password, isn't it very convenient?
About the permanent effect of custom commands on Mac terminal
For Mac custom commands to take effect, you must enter the terminal and enter the command: source ~/.bashrc to successfully introduce custom commands. Is there a way to make it permanent without entering the source command??The answer is yes.One file we are going to introduce is the bash.profile file that must be executed by the Mac to start the terminal.So we have to start editing it, just write the source command into this file, see the code for details
The terminal input: vim ~/.bash.profile to enter, the problem to pay attention to here, Mac will let you choose how to open this file
Select E to edit the file, if the default is read-only mode, you cannot write commands to this file, so pay special attention to this.
Enter the file and press i to edit, enter source ~/.bashrc and press esc to exit editing, then press :wq to complete editing and exit, just like this, you will find that after closing the terminal and restarting, you can use it without entering the source command.gomysql -uroot -p has entered the database
If this helps you a little bit, please give me a like, thank you!
边栏推荐
- Kotlin-学习的第五天之Handler
- 什么是仿射函数?
- Matlab用回归、SEIRD模型、聚类预测美国总统大选、新冠疫情对中美经济的影响
- How can recommender systems be trusted?A review of the latest "Trusted Recommender System" from Rutgers University, a 43-page pdf explaining the composition and technology of trusted RS
- tar zcf是单线程瓶颈
- LeetCode_67_二进制求和
- 1100 三角形面积
- What are the role of document management system for companies?
- 推荐系统如何可信?罗格斯大学最新《可信推荐系统》综述,43页pdf阐述可信RS组成与技术
- 自然堂品牌焕新升级,携手代言人王一博彰显美妆年轻新态度
猜你喜欢
深度学习初步认知
信号与系统【x(t)*h(t)=y(t) 求h(t)】附matlab代码
LeetCode #104.二叉树的最大深度
莅临GOPS大会龙智展位,获取Forrester最新报告:《Forrester Wave:2021年第四季度企业服务管理报告》
虚假信息处理最新有何进展?KDD2022《打击错误信息和应对媒体偏见》教程,161页ppt
随手记:laravel、updateOrCreate 和 updateOrInsert 的区别
学习笔记:第三章 栈与队列
iMeta | 深圳先进院戴磊组开发可同时提取共存菌株的组成和基因成分谱的菌株分析工具...
学习笔记:线性表的顺序表示和实现(二级指针实现)
Ansible自动化运维工具(二)playbook剧本
随机推荐
JMeter测试接口并发场景
Factorial of 1088 N
关于Mac终端自定义命令和Mysql命令问题
fillder4不间断提示the system proxy was change,看我解决
高数_复习_第3章:一元函数积分学
树查找(暑假每日一题 18)
头条二面:你确定ThreadLocal真的会造成内存泄露?
CVPR 2022 ActivityNet竞赛冠军:中科院深圳先进院提出高低分双模态行为识别框架
VSCode 必知必会的 20 个快捷键
兼容并蓄广纳百川,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang复合容器类型的声明和使用EP04
PHP使用glob()查找文件
OpenEuler's Ways to Improve Resource Utilization 02: Effects under Typical Applications
亚洲首个!朱永官院士荣获2022年国际土壤科学联合会李比希奖
实践篇1:深度学习之----LetNet之tensorflow2的实现
【无标题】
深度学习初步认知
期货开户安全吗?期货怎么开户安全?
瑞吉外卖项目实战Day06--手机端
Canvans:绘制饼图和玫瑰饼图
西湖大学鞠峰组招聘【塑料降解 / 污水工程 / 微生物学】方向博士后和科研助理...