ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
Linux 常用命令 1、批量压缩文件 tar -cvf hj.tar.gz hmall-\*.log zip  -q  -r zbak\_goods\_202211.zip  goods-2022-11\*.log 2、磁盘目录查询 du -h --max-depth=1 3、大文件切割 log='tail -n 1000 nohup.out' echo "$log" > nohup.out 4、阿里云部署失败 systemctl restart aliyun.service 或 /home/staragent/bin/staragentctl status /home/staragent/bin/staragentctl restart 5、#jar 启动命令 nohup java -jar  hjmall-conifg-admin-1.0-SNAPSHOT.jar    >/dev/null 2>&1 & #jar批量启动 sed -i 's/\\r$//' [java.sh](http://java.sh)    ///bin/bash^M: 坏的解释器: 没有那个文件或目录 chmod +7 [java.sh](http://java.sh)  //-bash: ./java.sh: 权限不够 6、生成普通的jar包 mvn clean package -D spring-boot.repackage.skip=true springboot  多模块项目父项目不要用spring-boot-maven-plugin 7、Kafka启动 单机:    /usr/local/kafka/kafka\_2.11-2.3.1 启动 :在/usr/local/kafka/kafka\_2.11-2.3.1目录下 1、bin/zookeeper-server-start.sh -daemon config/zookeeper.properties 2、bin/kafka-server-start.sh  -daemon    config/server.properties 集群: /usr/local/kafka/kafka01/bin/zookeeper-server-start.sh  /usr/local/kafka/kafka01/config/zookeeper.properties >/dev/null 2>&1 & /usr/local/kafka/kafka02/bin/zookeeper-server-start.sh  /usr/local/kafka/kafka02/config/zookeeper.properties >/dev/null 2>&1 & /usr/local/kafka/kafka01/bin/kafka-server-start.sh    /usr/local/kafka/kafka01/config/server.properties 2>&1 & /usr/local/kafka/kafka02/bin/kafka-server-start.sh    /usr/local/kafka/kafka02/config/server.properties 2>&1 & 8、redis 启动 win:    redis-server redis.windows.conf linux :nohup  ./redis-server  /usr/redis/redis-5.0.5/redis.conf  & 停止命令ps  -ef|grep  redis      kill -9  进程Id 9、启动nginx ①  进入sbin文件    命令:./nginx ②    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 10、nacos /usr/local/nacos/nacos 启动:sh [startup.sh](http://startup.sh) -m standalone 11、nexus cd /usr/local/nexus/nexus-3.9.0-01/bin ./nexus start 重启 ./nexus restart  重启服务 12、tail: inotify cannot be used, reverting to polling: Too many open files 处理方法: 在 /etc/sysctl.conf文件中加入下面的配置: fs.inotify.max\_user\_watches=1048576 fs.inotify.max\_user\_instances=1048576 sysctl -p /etc/sysctl.conf 使修改生效。再次执行 tail -f catalina.out 就可以了。 13、RocketMQ \# 1启动nameserver nohup sh bin/mqnamesrv & \# 查看nameserver日志 tail -f ~/logs/rocketmqlogs/namesrv.log \# 2启动broker nohup sh bin/mqbroker -n 127.0.0.1:9876 -c conf/broker.conf autoCreateTopicEnable=true & \# 查看broker日志 tail -f ~/logs/rocketmqlogs/broker.log