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:

  • linux file size in mb
  • linux file size in gb
  • ls gb
  • ls -ltr linux gb
  • linux ls in gb
  • linux ls file size
  • ls display size in GB
  • ls - to show file sizes in gb
  • ls display in gb
  • linux size in mb

4 thoughts on “Linux ls to show file size in GB or MB”

Leave a Reply