From "Unix and Linux system administration handbook - 5th ed"
- Process & threads: Use strace for deep debugging
- For risky commands i.e rm, try with -i (interactive) for confirmation first
From sadservers.com
- Scenario 1 (figure out which process is writing to some files):
fuser <filename>(fuser~ find user --> return list of processes using the supplied file)- Can also use
lsof | grep <filename>
- Scenario 2 (get most frequent visitor's IP from access log):
awk '{print $1}' access.log | sort | uniq -c | sort | tail -1 - Scenario 3 (find which port to knock): Using nmap against all ports
nmap -p- localhost