Unix/Linux 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 Linux or Unix Question    
 
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: 15 January 2015, 7:35 AM EST
Posts: 90
Thanks: 16
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 Unix and Linux 09-21-2012
pamu pamu is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 7 November 2014, 10:50 AM EST
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: 25 April 2015, 9:18 AM EDT
Location: Switzerland - GE
Posts: 6,026
Thanks: 182
Thanked 452 Times in 423 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 online now Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 25 April 2015, 11:38 AM EDT
Location: Aachen, Germany
Posts: 5,756
Thanks: 101
Thanked 1,519 Times in 1,428 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 11:56 AM.