Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Du -sk command in SunOS 5.10

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-21-2012
krsnadasa krsnadasa is offline
Registered User
 
Join Date: Nov 2011
Last Activity: 4 March 2016, 11:49 AM EST
Posts: 98
Thanks: 24
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:
Du -sk command in SunOS  5.10 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 Unix and Linux 09-21-2012
pamu pamu is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 8 August 2016, 12:07 PM EDT
Posts: 1,650
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 Unix and Linux 09-21-2012
vbe's Unix or Linux Image
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 24 August 2016, 11:07 AM EDT
Location: Switzerland - GE
Posts: 6,274
Thanks: 229
Thanked 506 Times in 470 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 Unix and Linux 09-21-2012
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 24 August 2016, 10:50 AM EDT
Location: Aachen, Germany
Posts: 9,218
Thanks: 179
Thanked 2,685 Times in 2,516 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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 02:04 PM.