find largest file

for i in G M K; do du -ah | grep [0-9]$i | sort -nr -k 1; done | head -n 11

So the idea is very simple and works wonders. Here is what this does. The for loop goes thru the Gs first, then the Ms, then the Ks, It sorts them and the end result is they are all concattaned on the screen and sorted from biggest to smallest from G to M to K.
1. take list of numbers and grep out numbers that have “number and G” and sort that
2. Do step one but instead of G use M
3. Do step one but instead of G use K
4. Concatenate the results


http://ram.kossboss.com/linux-sort-cant-sort-human-readable-fixworkaround-sorting-human-reable/

find . -newer modsecurity.conf -exec rm -rf {} \;  
##deleting lates files newer than the file ‘modsecurity.conf’

No comments:

Post a Comment