Linux ls to show file size in GB or MB

Today morning I was with one of my friends, and we were trying to figure something then we reached a point that he did a “ls” command to see the file details and sizes, well he used “ls -l” a very good and useful command but then I find him strugelling with calculating the file size, so I guided him with the h extension. In Linux most of the times when you are dealing with file sizes you can use h extension which stands for human readable. so what its very easy all you have to do is to add h to end of your switches.

like this:

so the result will be something like this instead of showing bytes:

Hope it’s helps you someday.


Incoming search terms:

  • ls size in gb
  • linux file size in gb
  • linux file size in mb
  • linux ls file size
  • ls gb
  • linux ls in gb
  • linux ls size in gb
  • ls display size in GB
  • ls -ltr linux gb
  • linux list file size in gb

Join the Conversation


Leave a comment

Leave a Reply