- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Different size for ls -l and du -ks for a file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2009 07:30 AM
05-12-2009 07:30 AM
I have 3 files with the same size when I do ls -l, but if I do du -ks the answer is very different with one of them. Any idea why?
I copied the file somewhere else and got a different 'du' for the file.
Any idea? the file was recreated and seems to always give the same size...
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2009 07:34 AM
05-12-2009 07:34 AM
Re: Different size for ls -l and du -ks for a file
The size given by 'ls -l' is the size the file was created as in Oracle.
The size given by 'du' is the amount of data actually in the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2009 07:52 AM
05-12-2009 07:52 AM
Re: Different size for ls -l and du -ks for a file
Two diffrent tools, two different ways of calculating used space.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2009 08:13 AM
05-12-2009 08:13 AM
SolutionThe first difference in size is that 'ls' reports characters and 'du -k' reports 1024-character _blocks_. The smallest block size will be that which the underlying filesystem was created with --- the 'bsize' value reported by 'mkfs -m'.
The tip-off that the files are sparse is their inflation when you use 'cp' to copy them. Database files are commonly allocated as sparse ones.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2009 08:48 AM
05-12-2009 08:48 AM
Re: Different size for ls -l and du -ks for a file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2009 03:37 AM
05-13-2009 03:37 AM
Re: Different size for ls -l and du -ks for a file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2009 03:41 AM
05-13-2009 03:41 AM