Possible Duplicate:how do you sort du output by size? I have a text file generated from the output ofdu --max-depth 1 -h > sizeOfHomeFolder.txtIt's contents are in this format:$ cat sizeOfHomeFolder.txt  | head776K    ./Expensemanager8.0K    ./workspace4.0M    ./mysql-tutorial3.6M    ./temp26M ./Desktop4.0K    ./Ubuntu One4.0K    ./Photos4.0K    ./PublicI need to sort this file based on 1st column i.e. the size. How to do this with the help of sort or sed or any other common unix utility ?
Sort a file based on 1 column
sort
If you have a not too old version of GNU sort, you can do sort -k 1,1h < input.txt-h is for human sort and is required to know that 1.0M is indeed larger than 512K.