Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

du -s -k differences between two identical directories

Status
Not open for further replies.

csgonan

MIS
May 2, 2007
118
US
I tarred a directory from a linux server to a solaris server. When I do a du -s -k on the directory, I get almost 150k difference in the file sizes. If I do a ls | wc -l, it is the same. If I look at the size of the individual files, it is the same.

I did an ls on the 2 directories and notice when a directory is within a directories I checking, it can show as 4096 on the linux side and 512 on the Solaris side. Will this alter my results? I do not see any missing files or file size differences. The only difference is the directory size.

I need to make sure these are identical directories?

Any ideas or recommendations?

Thanks
 
When a directory is created, it has a default size of 512. This expands as files are added to the directory, so what you describe is expected begaviour and will affect your comparisons.

I want to be good, is that not enough?
 
Sorry, I meant to add that although the size increases as files are added, the reverse isn't true as they are deleted. Think of the value as a kind of 'high water mark' for the directory in question. Recreating the directory and moving the files into it should revert it back to 512 or whatever. Careful with things like database files etc though!

I want to be good, is that not enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top