- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- size of a dir by du -sk and by ll differs !!!!!
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
Discussions
Discussions
Forums
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
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
тАО08-06-2010 07:18 PM
тАО08-06-2010 07:18 PM
1)the #du -sk /tmp/patch command shows directory size of /tmp/patch is 841000. I think it is in Kb
2) Now after entering into /tmp/patch and issueing the command ll the size (1st line after total) is 1359744. I think it is the Block no.
3)fstyp command shows the Block size is 8192.
I think it is in Byte.
If my understanding is right the du -sk should reflect the no coming by ' blocks by ll command X block size by fstype, i.e 135977 X 8). If it is so, there is huge difference between the o/p of both the commands
The capture is here,,,
uert1>pwd
/
uert1>fstyp -v /dev/vx/dsk/rootdg/tmpvol
vxfs
version: 6
f_bsize: 8192
f_frsize: 8192
f_blocks: 786432
f_bfree: 632042
f_bavail: 627105
f_files: 163136
f_ffree: 157984
f_favail: 157984
f_fsid: 34613437
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 16
f_fsindex: 9
f_size: 786432
uert1>
uert1>du -sk /tmp/patch
841000 /tmp/patch
uert1>
uert1>cd /tmp/patch
uert1>pwd
/tmp/patch
uert1>
uert1>ll
total 1359744
-rw-r--r-- 1 root sys 25651200 May 15 19:32 DASProvider_B.11.31.1004_HP-UX_B.11.31_IA_PA.depot
-rw-r--r-- 1 root sys 63406080 May 15 19:36 ONCplus_B.11.31.09.01.depot
-rw-r--r-- 1 21164 12753 52723 Mar 20 2008 PHCO_37807
-rw-r--r-- 1 root sys 30720 Mar 18 2008 PHCO_37807.depot
-rw-r--r-- 1 root sys 3692 Mar 19 2008 PHCO_37807.text
-rw-r--r-- 1 21164 12753 19784722 Apr 11 2009 PHCO_38048
.........................
.........................
.........................
Pls clear my confusion...
Regards....
Kuntal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2010 09:26 PM
тАО08-06-2010 09:26 PM
Re: size of a dir by du -sk and by ll differs !!!!!
uname -a
Then:
man ls
Look for "total".
> [...] If it is so, [...]
It's not.
> total 1359744
That's 1359744 512-byte blocks. 679872KB.
> 841000 /tmp/patch
That's still different, but many things are
possible. For example:
dyi $ ls -l
total 5712
-rw-r--r-- 1 root sys 2922037 Nov 18 2009 u6z3_ia64.zip
dyi $ du -ks .
8568 .
"total 5712" is only 2856KB.
But:
dyi $ ls -lA
total 17136
-rw-r--r-- 1 root sys 2922037 Nov 18 2009 .u6z3_ia64.zip
-rw-r--r-- 1 root sys 2922037 Nov 18 2009 .u6z3_ia64_2.zip
-rw-r--r-- 1 root sys 2922037 Nov 18 2009 u6z3_ia64.zip
For a normal user, "ls -l" ("ll") does not
always show all files.
Trust no one, I always say.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-07-2010 01:30 PM
тАО08-07-2010 01:30 PM
Solution'ls' and 'du' may indeed report file sizes. In particular, a sparse file will be smaller in size when interrogated with 'du' than with 'ls'. Empty blocks are reported by 'ls' whereas 'du' doesn't count them.
You can see the difference by creating a sparse file. Perhaps the simplest way is:
# dd if=/dev/zero of=mysparsefile bs=1k count=1 seek=5120
Now, compare:
# du mysparsefile
# ls -l mysparsefile
Using 'cp' to copy a sparse file causes the empty blocks to be allocated and is one way of discovering that a file is sparse. Do:
# cp mysparsefile mynonsparsefile
...and compare the 'ls' and 'du' sizes again.
Regards!
...JRF..,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2010 07:35 PM
тАО08-09-2010 07:35 PM
Re: size of a dir by du -sk and by ll differs !!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2010 07:37 PM
тАО08-09-2010 07:37 PM
Re: size of a dir by du -sk and by ll differs !!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2010 08:03 PM
тАО08-09-2010 08:03 PM
Re: size of a dir by du -sk and by ll differs !!!!!
> clearing my confusion.
And what was the cause of your confusion?
Someone else might read this someday, and he
might like to know what happened (more than
that you're happy now).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2010 03:40 AM
тАО08-10-2010 03:40 AM
Re: size of a dir by du -sk and by ll differs !!!!!
> my sincere thanks to both of you for clearing my confusion.
If you are happy with the answers you were given, please read the following about how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
...JRF...