|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
"du" and "ls" generating inconsistent file sizes
i've written a couple of shell scripts that pipe "du -b" and "ls -l -R" to a couple of awk programs. the output of each program is the total number and filesize of all of the images in a client's on-line photo gallery. just to be sure that each program is returning the same list i've output the list to the screen. both programs return the same files but with varying file size results. if i look back through each programs list of images i'll notice for instance:
du says pic13.jpg is 40960 bytes ls says pic13.jpg is 40146 bytes so, which result should i trust more, du or ls? |
|
#2
|
|||
|
|||
|
du gives you the size of the file as it resides on the file system. ( IE will will always give you a result that is divisible by 1024 ).
ls will give you the actual size of the file. What you are looking at is the difference between the actual size of the file and the amount of space on disk it takes. ( also called file system efficiency ). |
|
#3
|
|||
|
|||
|
thanks, i appreciate the response.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > "du" and "ls" generating inconsistent file sizes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|