linux - What is the deference between 'ls -lh' and 'ls -si'? -


i have executed both comments size seems different in both output.

ls -lh total 147m -rw------- 1 root root 3.4k sep 30 14:58 anaconda-ks.cfg -rw-r--r-- 1 root root  247 sep 30 14:58 install.post.log -rw-r--r-- 1 root root   54 sep 30 14:58 install.postnochroot.log -rw-r--r-- 1 root root 147m sep 30 14:58 jdk-7u79-linux-x64.gz  ls -l --si total 154m -rw------- 1 root root 3.5k sep 30 14:58 anaconda-ks.cfg -rw-r--r-- 1 root root  247 sep 30 14:58 install.post.log -rw-r--r-- 1 root root   54 sep 30 14:58 install.postnochroot.log -rw-r--r-- 1 root root 154m sep 30 14:58 jdk-7u79-linux-x64.gz 

if have checked manpage ls command man ls have seen following:

   -l     use long listing format    -h, --human-readable           -l and/or -s, print human readable sizes (e.g., 1k 234m           2g)    -i, --inode           print index number of each file    -s, --size           print allocated size of each file, in blocks 

so see, each parameter defines , how information put screen. see (the difference in size) -h or --human-readable command, output more readable filesizes instead of printing bytes. using -s print filesize in blocks on hdd, depends on block size of filesystem. information provided, filesystem has 1kb blocksize. real content of file 3.4kb, must fill blocks, on disk file requires 4kb or 4 blocks of space.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -