<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Counting file sizes ??? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570279#M873056</link>
    <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;You are right, it's a 2 gigs file.&lt;BR /&gt;&lt;BR /&gt;To calculate directory size in kilobytes :&lt;BR /&gt;#du -sk /dir&lt;BR /&gt;&lt;BR /&gt;To calculate size of selective files inkilobytes :&lt;BR /&gt;&lt;BR /&gt;a=`ls -al *.log ? awk '{print $5}'`&lt;BR /&gt;result=0&lt;BR /&gt;for c in $a &lt;BR /&gt;do &lt;BR /&gt;result=`expr $result + $c` &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;sizeInKilo=`expr $result     \/ 1024`&lt;BR /&gt;sizeInMega=`expr $sizeInKilo \/ 1024`&lt;BR /&gt;sizeInGiga=`expr $sizeInMega \/ 1024`&lt;BR /&gt;&lt;BR /&gt;echo "Size in KB = $sizeInKilo"&lt;BR /&gt;echo "Size in MB = $sizeInMega"&lt;BR /&gt;echo "Size in GB = $sizeInGiga"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Magdi &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 27 Aug 2001 10:14:23 GMT</pubDate>
    <dc:creator>Magdi KAMAL</dc:creator>
    <dc:date>2001-08-27T10:14:23Z</dc:date>
    <item>
      <title>Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570273#M873050</link>
      <description>I did an ll looking for the bigest files and I found one that is 2147483647. Now the way I read it this is  1000000000=1000megs so this would be like a file a little bigger then 2 gigs ? Am I right or an I counting wrong?&lt;BR /&gt;And is there a way I can run the ll command to come out with megs as output ?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Sat, 25 Aug 2001 17:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570273#M873050</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-08-25T17:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570274#M873051</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;Do a du -sk on the file. YOu will get the size in KB and it will be easier for you.&lt;BR /&gt;&lt;BR /&gt;For ex., du -sk file&lt;BR /&gt;&lt;BR /&gt;2046123  file&lt;BR /&gt;&lt;BR /&gt;This means it is of 2 GB.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Sat, 25 Aug 2001 18:04:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570274#M873051</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-25T18:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570275#M873052</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;you could do something like&lt;BR /&gt;du -kx * |sort -n&lt;BR /&gt;The last file/directory would be the biggest size in KB.&lt;BR /&gt;&lt;BR /&gt;If you only want the biggest size in files (in KB)then&lt;BR /&gt;&lt;BR /&gt;ls -al | grep '^-' | sort +4 |tail -1 | awk '{print $5, $9}'&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Sat, 25 Aug 2001 19:26:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570275#M873052</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-25T19:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570276#M873053</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;If you want the size in MB&lt;BR /&gt;&lt;BR /&gt;ls -al | grep '^-' | sort +4 |tail -1 | awk '{print $5/1048576, $9}'&lt;BR /&gt;&lt;BR /&gt;Ofcourse you do lots of formating, and this is not the only way to do it. &lt;BR /&gt;&lt;BR /&gt;-Regards&lt;BR /&gt;Ramesh</description>
      <pubDate>Sat, 25 Aug 2001 19:51:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570276#M873053</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-08-25T19:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570277#M873054</link>
      <description>2,147,483,647 bytes / 1024 = &lt;BR /&gt;2,097,151.999 KB / 1024 = &lt;BR /&gt;2,047.999 MB / 1024 = &lt;BR /&gt;1.999 GB&lt;BR /&gt;&lt;BR /&gt;So this file is essentially a 2 GB file.  You are reading the number and doing the math correctly.  &lt;BR /&gt;&lt;BR /&gt;As far as I know there is no option to tell 'll' to put output in MB directly.  You have been given some other good ideas though.&lt;BR /&gt;&lt;BR /&gt;By the way, if the file hit this size and didn't grow any more, I would guess that do not have the 'large files' option turned on for this LV.&lt;BR /&gt;&lt;BR /&gt;You can use fsadm to check and to turn on largefiles if you wish.  Do a 'man fsadm' for more info.&lt;BR /&gt;</description>
      <pubDate>Sun, 26 Aug 2001 02:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570277#M873054</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-08-26T02:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570278#M873055</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt; What Pat says is correct, and 1KB = 1024Bytes(not 1000Bytes) so 1GB = 1073741824 Bytes..... and there is no option for ll cmd to tell u size in MB.&lt;BR /&gt;&lt;BR /&gt;Cheers...&lt;BR /&gt;Satish.</description>
      <pubDate>Sun, 26 Aug 2001 09:39:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570278#M873055</guid>
      <dc:creator>Satish Y</dc:creator>
      <dc:date>2001-08-26T09:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570279#M873056</link>
      <description>Hi Richard,&lt;BR /&gt;&lt;BR /&gt;You are right, it's a 2 gigs file.&lt;BR /&gt;&lt;BR /&gt;To calculate directory size in kilobytes :&lt;BR /&gt;#du -sk /dir&lt;BR /&gt;&lt;BR /&gt;To calculate size of selective files inkilobytes :&lt;BR /&gt;&lt;BR /&gt;a=`ls -al *.log ? awk '{print $5}'`&lt;BR /&gt;result=0&lt;BR /&gt;for c in $a &lt;BR /&gt;do &lt;BR /&gt;result=`expr $result + $c` &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;sizeInKilo=`expr $result     \/ 1024`&lt;BR /&gt;sizeInMega=`expr $sizeInKilo \/ 1024`&lt;BR /&gt;sizeInGiga=`expr $sizeInMega \/ 1024`&lt;BR /&gt;&lt;BR /&gt;echo "Size in KB = $sizeInKilo"&lt;BR /&gt;echo "Size in MB = $sizeInMega"&lt;BR /&gt;echo "Size in GB = $sizeInGiga"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Magdi &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Aug 2001 10:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570279#M873056</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-08-27T10:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Counting file sizes ???</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570280#M873057</link>
      <description>Hi again ,&lt;BR /&gt;&lt;BR /&gt;in the expr command, you may see a strange signe some how like a V, but it is not :&lt;BR /&gt;&lt;BR /&gt;It is a back slash followed immediately by slash.&lt;BR /&gt;&lt;BR /&gt;Magdi</description>
      <pubDate>Mon, 27 Aug 2001 10:17:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/counting-file-sizes/m-p/2570280#M873057</guid>
      <dc:creator>Magdi KAMAL</dc:creator>
      <dc:date>2001-08-27T10:17:01Z</dc:date>
    </item>
  </channel>
</rss>

