The Linux ls
command comes with these options.
--block-size=SIZE
scale sizes by SIZE before printing them; e.g., '--block-size=M' prints sizes in units of 1,048,576 bytes; see
SIZE format below
-l use a long listing format
list subdirectories recursively
-s, --size
print the allocated size of each file, in blocks
I presume that ls -l
is the actual file size and ls -s --block-size=1
is the amount of disk space allocated to storing the file. (In this case 991232 = 968x1024 = 968K.)
$ ls -s --block-size=1 summary.pdf
991232 summary.pdf
$ ls -l summary.pdf
-rwxrwx---. 1 chris chris 989838 May 1 2015 summary.pdf
Is there an to get the file size in bytes without the additional information in "long listing format"?
du -s summary.pdf
gives the same output asls -s --block-size=1 summary.pdf
– GMaster Oct 06 '16 at 06:07