How to check file size in linux in mb
- how to see file size in linux
- how to find file size in linux
- how to check file size in linux using command
- how to view file size in linux terminal
Linux size of directory and subdirectories!
Linux find file size greater thanCheck File Size in Linux Command Line
How do you check the size of a file in Linux command line?
The simplest way is to use the ls command with option.
Here's an example:
As you can see in the example above, the size of the file is 14K.
Let's see it a bit more in detail.
Get file size with ls command
The ls command lists the contents of a directory.
But with the long listing option , it shows the file properties as well, file size being one of them.
But by default, the file size is in bytes and it's not easy to understand that.
Linux command to show file size in gb
This is why you should combine with the human-readable option .
It will start showing file sizes in proper units like KiB, MiB, GiB etc.
In the example below, you can see that the file size was first displayed as 13506 with option only and 14K with the
💡
Did you notice, I used KiB, MiB, GiB, not KB, MB and GB?
These days proper binary notation are KiB (=1024 Bytes), MiB (=1024 KiB) and decimal notation are KB (=1000 Bytes), MB (=1000KB). The ls command shows you the classic binary notation.