2020-10-27
1、編寫sh腳本語言
```shell
#!/bin/sh
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ]
then
echo “At time: `date "+%Y%m%d_%H:%M:%S"` :MySQL?is stop .”>> 日志路徑
/etc/init.d/mysqld start
else
e.....
2020-04-01
打開
/etc/sysctl.conf
文件最后加上
```shell
net.ipv4.icmp_echo_ignore_all = 1 //0允許 1禁止
```
這個代碼,然后執行
```shell
sysctl -p
```
使配置生效。.....
2019-11-22
查看日志中訪問次數最多的前10個IP
```shell
cat access_log |cut -d ' ' -f 1 |sort |uniq -c | sort -nr | awk '{print $0 }' | head -n 10 |less
```
查看日志中出現100次以上的IP
```shell
cat access_log |cut -d ' ' -f 1 |so.....
2019-11-12
我使用的是SecureCRT軟件連接linux
1、下載
本地目錄路徑設置:選項》會話選項》SFTP會話》本地目錄
命令:``sz dbname.sql``
------------
2、壓縮
命令:``tar -zcvf file.tar.gz file/``
------------
3、解壓
命令:``unzip -o -d .....
2019-11-08
方法1、
如果是root權限,可以:wq!
強行保存退出
方法2、
vi 進入的時候 選擇E(edit anyway ) 就可以保存并退出vi.....
2019-10-10
命令 :
```shell
crontab -e
```
添加:
```shell
00 10 * * * /usr/bin/curl http:/www.xxxx.com/xxxx.php
```
上面語句表示每天10點訪問一次php文件.....