du apparent-size

TA/Common 2013. 7. 29. 16:34

Apparent size is the number of bytes your applications think are in the file. It's the amount of data that would be transferred over the network (not counting protocol headers) if you decided to send the file over FTP or HTTP. It's also the result of cat theFile | wc -c, and the amount of address space that the file would take up if you loaded the whole thing using mmap.

Disk usage is the amount of space that can't be used for something else because your file is occupying that space.

In most cases, the apparent size is smaller than the disk usage because the disk usage counts the full size of the last (partial) block of the file, and apparent size only counts the data that's in that last block. However, apparent size is larger when you have a sparse file (sparse files are created when you seek somewhere past the end of the file, and then write something there -- the OS doesn't bother to create lots of blocks filled with zeros -- it only creates a block for the part of the file you decided to write to).

 

du --apparent-size  : 실제 파일의 사이즈를 보여줌 즉, 네트웍상으로 전달되는 데이터 사이즈라고 보면 됨.

일반적인 ls, du 등으로 파일 사이즈 확인시에는 해당 파일이 차지하는 블럭사이즈를 계산하게 되므로 보통 --apparent-size로 보는 것보다 크게 보임.

'TA > Common' 카테고리의 다른 글

sharedata 데렉토리 속성 정의  (0) 2013.08.26
서버 날짜 수정 - date  (0) 2013.08.26
bash: /dev/null: Permission denied  (0) 2013.02.05
부팅시 자동 마운트 방법  (0) 2013.02.05
서버가 부팅시 시작되는 서비스들 확인  (0) 2013.02.05
Posted by 옥탑방람보
,