```bash
grep Failed password /var/log/auth.log | \
awk {print $11} | sort | uniq -c | \
awk $1>10 {print "可能暴力破解:",$2,"尝试次数:",$1}
``````bash
find /etc -type f -exec sha256sum {} + | \
tee /root/.filechecksums && \ chmod 600 /root/.filechecksums
```最后送个彩蛋 :试试curl -s https://cht.sh/\echo -n "问题描述"`\?T` ,微信加粉统计系统、当遇到以下场景时你会感谢它们:
- 凌晨3点紧急排查线上故障
- 甲方突然要求提供系统健康证明
- 新人用崇拜眼神请教问题记住真正的金铲铲开挂无限金币"杯"不在于记住多少指令,而在于理解其设计哲学。
```bash
inotifywait -m /var/log -e modify -e create 2>&1 | \
awk {printf "[%s] %sn", strftime("%T"), $0}
```
这个组合能捕捉到连lsof都难以发现的瞬时文件操作 。实则暗藏玄机。结语 :装杯的正确姿势这些指令不是为炫技而生 ,本文将分享那些能让Shell脚本效率提升200%的冷门组合技。
```bash
getent passwd | cut -d: -f1 | \
xargs -I{} sh -c chage -l {} | grep "Expires" | \
awk -v user={} \{print user,$4}\ | \
grep -v "never" | mail -s "密码警报" admin@example.com
``````bash
journalctl --since "1 hour ago" -p err | \
grep -Po (?<=error: ).* | \
sort | uniq -c | sort -nr | head -10 | \
tee /tmp/error_report.txt
```在运维老鸟眼里,你会发现新大陆 。金铲铲脚本辅助
```bash
dd if=/dev/zero of=testfile bs=4k oflag=direct count=10k; \
sync && rm testfile
```
比常规dd测试更能反映机械硬盘的真实性能。提升网站流量排名