954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Using ls to list file sizes to 3 significant figures in human-friendly form

Dear Folks,

Using bash on Linux, how would I list file sizes to 3 significant figures in human-friendly form?

If I try

ls -lh


I get 2 significant figures, but I would like to get 3 significant figures.

Also, there is the almighty muddle between megabytes and mebibytes that leads to confusion about what is being really output, but I am happy with either version so long as I get three sig figs and know whether it is mega or mebi :-)

TIA.

P.S. Apologies for cross-posting. Originally posted at http://www.daniweb.com/forums/post1322780.html#post1322780 and re-posted here in the hope of a better repsonse.

polygon
Newbie Poster
8 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: