commm
- echo: 打印字符串
1 查看进程
- 查看:ps -ef | grep 进程名
- 杀死:kill -s 9 进程ID
2 文件文件夹
- 删除文件夹:rm -rf 文件夹名
- 删除文件:rm -f 文件名
- 创建文件夹:mkdir 文件夹名
3 查看端口号占用
netstat -tunlp |grep 端口号
4 查看内存
cat /proc/meminfo
5 linux后台运行springboot项目
5.1 运行
nohup java -jar xxx.jar &
日志打印在nohup.out中
5.2 停止
- 列出后台进程
ps -ef | grep java
- 杀死进程
kill -9 [pid]
6 nginx
- 查看配置文件位置:nginx -t
- 重新加载配置:进入nginx可执行目录sbin,执行:./nginx -s reload
7 Redis
查看Redis目录
ps -ef|grep redis
,得到了进程号xxxx
ls -l /proc/xxxx/cwd
查看配置文件目录
redis-cli info | grep config
查看集群信息
redis-cli -c
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 查找内容
- 查找某目录下所有压缩包中内容:zcat *|grep xxx
*
表示所有目录