<?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: determining directory size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902934#M105352</link>
    <description>To get the size in kilobytes, use '-k':&lt;BR /&gt;&lt;BR /&gt;du -ks /dir_name&lt;BR /&gt;&lt;BR /&gt;If there are mount points under this directory, and you don't want to include anything under those mount points, then use '-x':&lt;BR /&gt;&lt;BR /&gt;du -ksx /dir_name&lt;BR /&gt;&lt;BR /&gt;So, if you set:&lt;BR /&gt;&lt;BR /&gt;sizekb=`du -ksx /dir_name | awk '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;let sizemb=sizekb/1024 ; echo $sizemb&lt;BR /&gt;&lt;BR /&gt;will give you the size in Mb.</description>
    <pubDate>Wed, 12 Feb 2003 17:07:49 GMT</pubDate>
    <dc:creator>Mladen Despic</dc:creator>
    <dc:date>2003-02-12T17:07:49Z</dc:date>
    <item>
      <title>determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902932#M105350</link>
      <description>I am trying to find the size of a directory that has other directories under it...such as sub-directories. I know du can help in this regard, but it gives size in block sizes. Anyway I can ge tit to report the size in megabytes? I am doing this because I am going to create another directory of similiar structure, but don't want to waste any resource by estimating the size. Oh, yea, I don't want to add up the files themselves. Also, when you run du, the results come back as block sizes only, how can you tell what size the block is in megabytes? Thanks in advance for any help.</description>
      <pubDate>Wed, 12 Feb 2003 16:59:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902932#M105350</guid>
      <dc:creator>denise_7</dc:creator>
      <dc:date>2003-02-12T16:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902933#M105351</link>
      <description>du -sk &lt;DIRECTORY&gt;&lt;BR /&gt;&lt;BR /&gt;-s             Print only the grand total of disk usage for each&lt;BR /&gt;                          of the specified name operands.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-k             Gives the block count in 1024-byte blocks.&lt;/DIRECTORY&gt;</description>
      <pubDate>Wed, 12 Feb 2003 17:02:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902933#M105351</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2003-02-12T17:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902934#M105352</link>
      <description>To get the size in kilobytes, use '-k':&lt;BR /&gt;&lt;BR /&gt;du -ks /dir_name&lt;BR /&gt;&lt;BR /&gt;If there are mount points under this directory, and you don't want to include anything under those mount points, then use '-x':&lt;BR /&gt;&lt;BR /&gt;du -ksx /dir_name&lt;BR /&gt;&lt;BR /&gt;So, if you set:&lt;BR /&gt;&lt;BR /&gt;sizekb=`du -ksx /dir_name | awk '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;let sizemb=sizekb/1024 ; echo $sizemb&lt;BR /&gt;&lt;BR /&gt;will give you the size in Mb.</description>
      <pubDate>Wed, 12 Feb 2003 17:07:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902934#M105352</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2003-02-12T17:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902935#M105353</link>
      <description>HI:&lt;BR /&gt;&lt;BR /&gt;Do you mean filesystem size, as in a 'mountpoint' when you say "[I want...to create another directory of similiar structure, but don't want to waste any resource"?&lt;BR /&gt;&lt;BR /&gt;Remember, once space (blocks) are allocated for a directory, that is, as files are added to it, the directory's space will never shrink.  Therefore, a once-heavily populated, but now empty, directory will consume more space than a freshly made one.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 12 Feb 2003 17:07:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902935#M105353</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-02-12T17:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902936#M105354</link>
      <description># du -k &lt;BR /&gt;&lt;BR /&gt;This will report the size in Kbytes. You can then convert it to MBytes by deviding it with 1024.</description>
      <pubDate>Wed, 12 Feb 2003 17:08:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902936#M105354</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-02-12T17:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: determining directory size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902937#M105355</link>
      <description>Find larger directories in /var: &lt;BR /&gt;&lt;BR /&gt;du -kx /var | sort -rn &amp;gt; /tmp/du.var &lt;BR /&gt;&lt;BR /&gt;Now look at the top lines in /var, u will see larger ones first, example : &lt;BR /&gt;&lt;BR /&gt;/var/mail -- (someone got a giant email) &lt;BR /&gt;/var/spool -- (someone is printing a massive file) &lt;BR /&gt;/var/adm -- (probably a big logfile) &lt;BR /&gt;/var/adm/syslog -- (definitely a big logfile) &lt;BR /&gt;/var/adm/sw -- (patches, but cleanup will require space in /var) &lt;BR /&gt;/var/tmp -- (someone has a bunch of big files in /var/tmp)&lt;BR /&gt;&lt;BR /&gt;Just to add to above !</description>
      <pubDate>Wed, 12 Feb 2003 17:39:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-directory-size/m-p/2902937#M105355</guid>
      <dc:creator>T. M. Louah</dc:creator>
      <dc:date>2003-02-12T17:39:23Z</dc:date>
    </item>
  </channel>
</rss>

