mac终端常用命令及环境配置

mac终端常用命令及环境配置

viEcho Lv5

常用命令

  • 查看文件下列表 sl
  • 查看端口占用 lsof -i:8080
  • 杀掉某pid对应的进程 kill pid
  • 启动redisredis-server
  • 启动redis客户端redis-cli
  • 查看redis相关的后台进程ps -ef | grep redis
  • 检测6379端口是否在监听 netstat -anvp tcp |grep 6379

mysql修改密码

1
2
3
4
5
6
# 进入root 用户下
sudo su
#输入密码
source /etc/profile
//在root用户下进入mysql
mysql -uroot -p123456

修改环境变量

1
2
3
open -e .bash_profile
# 修改完后更新生效
source .bash_profile
  • Title: mac终端常用命令及环境配置
  • Author: viEcho
  • Created at : 2022-03-17 23:57:12
  • Updated at : 2024-01-26 14:59:02
  • Link: https://viecho.github.io/2022/0317/mac-command-shell.html
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
mac终端常用命令及环境配置