Re:Devops/Sysadmin Cheatsheet
by activepeanut on Friday January 11, 2013 @08:22PM
(#5046054)
Instead of:
ls -al | sort -nk5
I suggest: ls -larSI upvoted you the other day and it seems coming back today i have the upvote option again? Weird.
Either way, have an upvote!
Run something forever watch command
Overview of all disks du should be df.
Find files over 100mb find . -size +100M
Low hanging fruit for size ls -al | sort -nk5
Files created (modified) within the past 7 days: find . -mtime -7
Find files older than 14 days: find .gz -mtime +14 -type f This will break when you have more archived files in the directory than the shell's glob char can support. Use: find . -mtime +14 -type f -name '*.gz' and it will run quicker too.
TCP Sockets in use, "netstat -antp" will be faster and also lists the process id.
EDIT: formatting