I am sorting the output of an "ls" to put files in descending size:
find / -size +81920 -exec ls -al {} \; | sort -r -k 5 > /large.txt
However, the sort on field 5 (-k 5) ignores leading spaces (of course) so you get:
90
600
31
100
Is there a way to get leading zeros in the ls output so we get:
600
100
090
031
Thanks
There's no need for sarcastic replies, we've not all been this sad for that long!
find / -size +81920 -exec ls -al {} \; | sort -r -k 5 > /large.txt
However, the sort on field 5 (-k 5) ignores leading spaces (of course) so you get:
90
600
31
100
Is there a way to get leading zeros in the ls output so we get:
600
100
090
031
Thanks
There's no need for sarcastic replies, we've not all been this sad for that long!