How can i find the biggest files and folders in /(root) file systems?
sudo du / 2>/dev/null | sort -rn | head
sudo du -a / 2>/dev/null | sort -rn | head
Thanks,
When running the following command:
du /var/ 2>/dev/null | sort -rn | head
I am getting the output:
41432328 /var/
19771516 /var/lib
15910316 /var/spool
15910188 /var/spool/mail
15796124 /var/lib/enswitch
5772612 /var/lib/enswitch/mailboxes
5725264 /var/log
5262072 /var/lib/enswitch/recordings
5211044 /var/lib/enswitch/recordings/sip
4639680 /var/lib/enswitch/backups
But when i am running the command:
du -h /var/ 2>/dev/null | sort -rn | head
I am getting the output:
1020K /var/lib/enswitch/recordings/sip/989/940
1020K /var/lib/enswitch/recordings/sip/934/177
1020K /var/lib/enswitch/recordings/sip/896
1020K /var/lib/enswitch/recordings/sip/828/262
1020K /var/lib/enswitch/recordings/sip/574
1020K /var/lib/enswitch/recordings/sip/564/910
1020K /var/lib/enswitch/recordings/sip/540/758
1020K /var/lib/enswitch/recordings/sip/438/264
1020K /var/lib/enswitch/recordings/sip/425/287
1020K /var/lib/enswitch/recordings/sip/301/566
I think i should have got the earlier output with the sizes in human readable form. But the output seems to be different. What is the reason?
Thanks in advance
"human readable" is a misnomer; it is really "abbreviated".
Since you are sorting abbreviations, not numbers, your results reflect that. 1030K is numerically larger than 1020M.