当前位置:网站首页>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!
边栏推荐
猜你喜欢
接口测试经典面试题:Session、cookie、token有什么区别?
Ansible自动化运维工具(一)安装及模块
门外汉掌握数据分析处理技术的路线图
深度学习初步认知
What are the latest developments in the handling of false information?KDD2022 "Fighting Misinformation and Responding to Media Bias" tutorial, 161 pages ppt
学习与尝试 --> 事件风暴
NAACL2022 NER SOTA - RICON study notes
Redis布隆过滤器
梅科尔工作室OpenHarmony设备开发培训笔记-第一章学习笔记
网络工程师怎么系统性学习?这份网工资料包帮你解决
随机推荐
iMeta | 深圳先进院戴磊组开发可同时提取共存菌株的组成和基因成分谱的菌株分析工具...
学习笔记:栈的应用1_递归(重点)
tar zcf是单线程瓶颈
借问变量何处存,牧童笑称用指针,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang类型指针(Pointer)的使用EP05
监控工具普罗米修斯(Prometheus)的介绍与安装
虚假信息处理最新有何进展?KDD2022《打击错误信息和应对媒体偏见》教程,161页ppt
1259 Alice and Bob
Kotlin委托属性知识点
面试面到自闭,字节软件测试岗五轮面试,四个小时灵魂拷问...
学习笔记:线性表的顺序表示和实现(二级指针实现)
From interview to autism, five rounds of interviews for byte software testing post, four hours of soul torture...
莫让“学院派”限制我们的思维:在数组的中间位置删除数据一定比链表慢?
正则表达式与文本处理器
CVPR 2022 ActivityNet竞赛冠军:中科院深圳先进院提出高低分双模态行为识别框架
rk3588使用npu进行模型转换和推理,加速AI应用落地
【无标题】
1100 三角形面积
fillder4不间断提示the system proxy was change,看我解决
自定义MVC
技术分享活动