-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcommoncmd.txt
33 lines (27 loc) · 1.1 KB
/
commoncmd.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
passwd
tar -zcvf web.tar.gz /var/www/html/
scp 文件路径 用户名@IP:存放路径
#查看已建立的网络连接及进程
netstat -antulp | grep EST
#查看指定端口被哪个进程占用
lsof -i:端口号 或者 netstat -tunlp|grep 端口号
#备份mysql数据库
mysqldump -u 用户名 -p 密码 数据库名 > back.sql
mysqldump --all-databases > bak.sql
#还原mysql数据库
mysql -u 用户名 -p 密码 数据库名 < bak.sql
mysql -u 用户名 -p 密码
sourced:\sqlfile.sql;
crontab -l
#查看页面访问排名前十的IP
cat /var/log/apache2/access.log | cut -f1 -d | sort | uniq -c | sort -k -r | head -
#查看页面访问排名前十的URL
cat /var/log/apache2/access.log | cut -f4 -d | sort | uniq -c | sort -k -r | head -
#杀马
ps aux | grep www-data | awk '{print $2}' | xargs kill -9
ps aux | grep www-data | grep -v grep | awk '{print $2}' | xargs kill -9
kill -9 -1
#重启服务
service php-fpm restart
#批量上waf
sudo find /var/www/html/ -type f -path "*.php" | xargs sed -i "s/<?php/<?php\nrequire_once('\/tmp\/waf.php');\n/g"