指令学习
- 快捷键
- mac ide执行SQL: command+ENTER
- 类型智能提示: ⌃⇧Space (Code | Code Completion | Type-Matching)
- 代码智能提示:⌃Space
- 连按两次Ctrl来获取ide的常用功能
- Search Everywhere popup (double Shift)
- 修改行分隔符:select File | File Properties| Line Separators from the main menu, and then choose the desired line ending style.
- refact提示:⌃T,
- 查看抽象方法的实现:⌥⌘B
- 打开UML类图:⌥⇧⌘U
- 查找git分支:双击Shift
- 产生get,set方法: ⌘N
- Mac 下查看java home: /usr/libexec/java_home -V
- Java home: /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
- Curl 发消息指令:curl -H Content-Type:application/json -X POST -d '{"bizCode":"dw.data","eventCode":"sendBasicMsg","sceneCode":"normal","originalId":"text_new_version","pushModelList":[{"readType":"push","templateCode":"9939cfce39f844dd88d320c439196e31","order":1,"iconUrl":"https://cdn.dewu.com/node-common/8a6a28d9-fc79-dff6-c0fc-c73ba2bf690b.jpg"}],"appKey":"999999bee244001","pushParamList":[{"userId":1696091987}],"customParam":{"sku_title":"测试","sku_id":"88602542","spu_id":"14768"},"urlParam":{},"startTimeStamp":1628055739117}' http://localhost:10074/sendMsg?noSign=true
- 查找压缩文件内容:gzip -dc ./文件名.gz | grep “8723183”
- 显示隐藏文件:
- 列编辑快捷键
-
- Redis
- 安装:brew install redis
- 启动:brew services start redis
- 连接redis: redis-cli -h d1-redis.dewus.cn -a HZxVS3jEq3ZNYiJz
- 选择某个库:select 8
- 查看jar依赖
- Redis
# 1. 获取jar 路径
whereis jar
# 2. 使用jar -tf 命令 查看版本信息
/opt/alibaba/bin/jar -tf peak.jar | grep log4j
BOOT-INF/lib/log4j-to-slf4j-2.11.2.jar
BOOT-INF/lib/log4j-api-2.11.2.jar
BOOT-INF/lib/log4j-1.2.17.jar
-
- 查看mvn 依赖树 mvn dependency:tree -Dverbose -Dincludes=
- Linux 计算行数: wc -l filename
- Linux 查看进程端口号:netstat -nap | grep1095
- Mongo 聚合查询: db.user_send_20211101.aggregate([{"$match":{"channelType":"jpush"}},{"$group":{"_id":"null","count":{"$sum":"$sendCount"}}}],{"cursor":{}});
- monog 统计查询: db.msg_result_statistics_v2.count({"_id":{"$gte":ObjectId("61cdd7800000000000000000"),"$lte":ObjectId("61cf29000000000000000000")},"channelType":{"$ne":"jpush"}})
- Mongo distinct: db.msg_call_back_20211221.distinct("code",{"channelType":"xm"})
- CSS定位器读取浏览器的内容: $$(".select-search-options span").forEach(it => console.log(it.innerText))
- 已编译的jar包如何查看依赖
- Linux 查看本文件夹底下各个文件的大小:du -sh *
- jar -ft xxx.jar | grep consul-discovery
- Linux 查看连接占用内存: 使用ulimit -a 查看stack size,即为每个连接数占用的内存。
- 查看mongo连接数: db.serverStatus().connections
-
- Linux 查看线程状态: top -Hp pid
- ps -eLf|grep greatdbd|wc -l 监控greatdbd进程的线程数
- netstat -n | grep tcp | grep 3306 | wc -l 监控网络客户连接数
- 查看进程使用的jar包: lsof -p 19377 | grep -E "jedis|pool|redis"
清理当前文件夹和子文件的
find . -name '*.DS_Store' -type f -delete