1. 清空dns缓存,域名指向的IP发生变化时使用
service nscd restart
# /etc/init.d/dns-clean start
2. 防火墙
ufw status numbered // 查看当前的防火墙
ufw delete 3 // 按序号删除
ufw status // 查看状态
ufw enable // 启用防火墙
// 添加防火墙, 允许192.168.128.0/17 使用tcp 协议访问 192.168.193.8:3000
ufw allow proto tcp from 192.168.128.0/17 to 192.168.193.8 port 3000
// 允许192.168.128.0/17 访问 6381端口
ufw allow from 192.168.128.0/17 to any port 6381
3. 查看被系统kill的进程
// 1.
egrep -i -r 'killed process' /var/log
// 2.
dmesg -T
4. grep 正则
tail -n 20 file.txt | grep -o 'item_id": "[0-9]*"'
5. history加时间戳
vi /etc/profile
添加: export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
保存退出:
source /etc/profile