Du -sk command in SunOS 5.10 | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Du -sk command in SunOS 5.10

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-21-2012
krsnadasa krsnadasa is offline
Registered User
 
Join Date: Nov 2011
Last Activity: 27 May 2014, 8:07 AM EDT
Posts: 82
Thanks: 14
Thanked 1 Time in 1 Post
Du -sk command in SunOS 5.10

Hi,

I am little confuse after using

Code:
du -sk on file .

I have file listing like:

Code:
-rw-r--r-- 1 Xuser Ygrp 51419029531 Sep 21 07:40 catalina.out

when i issue cmd :
Code:
du -sk catalina.out

gives output as

Code:
1804511 catalina.out

This means 1804511 KB. Which means 1 GB.

But if i calculate using 51419029531 bytes / 1024 bytes = 50213896.0 KB

50213896.0/1024=49037 MB

49037/1024= 47 GB

It shows 47 GB but du shows 1 GB.

Please let me know where I am doing wrong.

Thanks
Krsna

Moderator's Comments:
Please view this code tag video for how to use code tags when posting code and data.

Last edited by vbe; 09-21-2012 at 03:47 AM..
Sponsored Links
    #2  
Old 09-21-2012
pamu pamu is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 15 September 2014, 8:06 AM EDT
Posts: 1,649
Thanks: 58
Thanked 478 Times in 474 Posts
try this also...


Code:
stat -c%s catalina.out

ls -lh catalina.out

du -h catalina.out

Sponsored Links
    #3  
Old 09-21-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 24 October 2014, 4:42 PM EDT
Location: Switzerland - GE
Posts: 5,835
Thanks: 162
Thanked 415 Times in 390 Posts
You will have to explain how you got your first figure...

Look:

Code:
slo4:/export/home/vbe $ uname -r
5.10
slo4:/export/home/vbe $ ls -l amanda-3.3.0.tar.gz
-rwxr-xr-x   1 vbe      sysadm   4193702 Nov  7  2011 amanda-3.3.0.tar.gz
slo4:/export/home/vbe $ du -sk amanda-3.3.0.tar.gz
4100    amanda-3.3.0.tar.gz

    #4  
Old 09-21-2012
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 25 October 2014, 5:15 AM EDT
Location: Aachen, Germany
Posts: 4,425
Thanks: 73
Thanked 1,082 Times in 1,020 Posts
Might be a "sparse file", i.e. a file with holes in it. List it with ls -s , col 1 will show the actually used blocks on disk, as does du , col 5 will show what the file system thinks the size is:
Code:
$ ls -ls fn
8 -rw-r--r-- 1 root root 4194339 Sep 21 09:56 fn
$  du -sk fn
8    fn

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
chmod command in SunOS hikaru022002 Solaris 4 03-01-2012 05:44 AM
SunOS: How to exclude directory in find command? saps19 Shell Programming and Scripting 3 03-28-2011 04:24 AM
Tar Command in SunOS 5.6 mojoman UNIX for Dummies Questions & Answers 1 05-07-2010 03:55 PM
usleep command is not available in SunOS pa.chidhambaram Solaris 5 06-23-2009 05:31 PM
Migration of binary file from Sunos 5.8 to Sunos 5.9 Arvind Maurya UNIX for Advanced & Expert Users 1 07-12-2005 06:23 AM



All times are GMT -4. The time now is 08:38 AM.