| 1 | # biggest dirs |
| 2 | du -xh --max-depth=1 / 2>/dev/null | sort -h | tail |
| 3 | |
| 4 | # who is hammering the web server |
| 5 | awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head |
| 6 | |
| 7 | # find files changed in the last day |
| 8 | find /etc -type f -mtime -1 |
| 9 | |
| 10 | # port in use by what |
| 11 | ss -tlnp | grep :8080 |
| 12 | |
| 13 | # replace in place, keep backup |
| 14 | sed -i.bak 's/foo/bar/g' *.conf |
| 15 | |
| 16 | # tar over ssh |
| 17 | tar czf - dir | ssh host 'cat > dir.tgz' |
| 18 | |
| 19 | # json pretty print |
| 20 | python -m json.tool < file.json |
| 21 |