du and ls show different sizes for the same file


du and ls show different sizes for the same file

After uncompressing a file i was confused to see different sizes for the same file with du and ls command


When i used du it was showing the size




But ls output was showing a different size


So i realized these commands works in different ways

ls with option -l shows the allocated size but du shows the actual size (amount of space used).

If you want to see actual size with ls use -s option. If you use this way you can see both ls and du gives same output, in this case actual size is printer first






Comments

Popular posts from this blog

The native OCI driver could not be loaded- while using thick client with sqldeveloper

WEB ADI - issues encountered during initial access

XXX is not a valid responsibility for the current user. Please contact your System Administrator" – oracle apps 11i