How can I get the disk usage information that is in human readable format -h option but is also sorted correctly.
Right now if i use -h option it does not get sorted correctly i.e G M K are not in ascending order.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t quite understand the question. Why isn’t is not sorted?
edit should ask for the same unit, e.g. always kilobytes with
du -kIf you need to output using “human friendly” units, make the conversion after sorting (perhaps using
awk).AWK Script: This is how we can sort the files .. don’t know if we can using the
-h optionbut this is kinda like simulating the-h option. Results are more accurate 😉