Why does the "ls -lh" option round down a file size so much?
Posted: 2019/08/20 13:40:18
If I look at the file /usr/sbin/mysqld with "ls -l" or include the options "-s" or "-si" on CentOS 7... it returns with the size of
But when I include the "-h" option to return it in human readable form... It rounds the size down by 10Mb... Which seems like a pretty large discrepancy!
Can someone explain why there's such a big difference? I understand the default block size of the "ls" command is 1000 bytes and the human readable option is 1024 bytes... But even that doesn't explain the difference
THANKS!
Code: Select all
[root@centos7lab ~]# ls -l /usr/sbin/mysqld
-rwxr-xr-x. 1 root root 251284320 Dec 21 2018 /usr/sbin/mysqld
[root@centos7lab ~]# ls -ls /usr/sbin/mysqld
245396 -rwxr-xr-x. 1 root root 251284320 Dec 21 2018 /usr/sbin/mysqld
[root@centos7lab ~]# ls -lsi /usr/sbin/mysqld
610480 245396 -rwxr-xr-x. 1 root root 251284320 Dec 21 2018 /usr/sbin/mysqld
[root@centos7lab ~]# ls -lh /usr/sbin/mysqld
-rwxr-xr-x. 1 root root 240M Dec 21 2018 /usr/sbin/mysqld
But when I include the "-h" option to return it in human readable form... It rounds the size down by 10Mb... Which seems like a pretty large discrepancy!
Code: Select all
-rwxr-xr-x. 1 root root 240M Dec 21 2018 /usr/sbin/mysqld
THANKS!