Hello.
I've given a task to 'print all the files in a directory in the format---<File name> <Size in Byte> <No of Disk blocks used> ,sorted by 'disk blocks used'(reverse order)..............if same no of disk blocks are used by two files then largest file will be printed first'
I used the stat command like this-
stat * -c "%n %s %b" | sort -n -r -k 2,3
but if there is a whitespace in the filename then the sorting becomes all messed up, .......if there is any way to interchange columns or anything else.
thanks for any help