linux常用命令

commm

  1. echo: 打印字符串

1 查看进程

  1. 查看:ps -ef | grep 进程名
  2. 杀死:kill -s 9 进程ID

2 文件文件夹

  1. 删除文件夹:rm -rf 文件夹名
  2. 删除文件:rm -f 文件名
  3. 创建文件夹:mkdir 文件夹名

3 查看端口号占用

netstat -tunlp |grep 端口号

4 查看内存

cat /proc/meminfo

5 linux后台运行springboot项目

5.1 运行

nohup java -jar xxx.jar &

日志打印在nohup.out

5.2 停止

  1. 列出后台进程
    ps -ef | grep java
    
  2. 杀死进程
    kill -9 [pid]
    

6 nginx

  1. 查看配置文件位置:nginx -t
  2. 重新加载配置:进入nginx可执行目录sbin,执行:./nginx -s reload

7 Redis

查看Redis目录

  1. ps -ef|grep redis,得到了进程号xxxx
  2. ls -l /proc/xxxx/cwd

查看配置文件目录

redis-cli info | grep config

查看集群信息

  1. redis-cli -c
  2. cluster info

8 查看内存

free
Options:
 -b, --bytes         show output in bytes
 -k, --kilo          show output in kilobytes
 -m, --mega          show output in megabytes
 -g, --giga          show output in gigabytes
     --tera          show output in terabytes
 -h, --human         show human-readable output
     --si            use powers of 1000 not 1024
 -l, --lohi          show detailed low and high memory statistics
 -t, --total         show total for RAM + swap
 -s N, --seconds N   repeat printing every N seconds
 -c N, --count N     repeat printing N times, then exit
 -w, --wide          wide output

     --help     display this help and exit
 -V, --version  output version information and exit

9 安装依赖查找

rpm -qa | grep mysql

10 查找内容

  1. 查找某目录下所有压缩包中内容:zcat *|grep xxx

    *表示所有目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值