<?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: ls -l du in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543357#M839302</link>
    <description>If you have subdirectories in your filesystems such as:&lt;BR /&gt;/dev/vg01/lvol1  /home&lt;BR /&gt;/dev/vg01/lvol2 /home/matthew&lt;BR /&gt;/dev/vg01/lvol3 /home/matthew/emc&lt;BR /&gt;&lt;BR /&gt;and you are sitting in /home and don't want the rest to show up use -x option:&lt;BR /&gt;&lt;BR /&gt;du -x .|sort -nr|more&lt;BR /&gt;&lt;BR /&gt;Matthew from Boston</description>
    <pubDate>Fri, 13 May 2005 08:11:09 GMT</pubDate>
    <dc:creator>Matthew Ghofrani</dc:creator>
    <dc:date>2005-05-13T08:11:09Z</dc:date>
    <item>
      <title>ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543352#M839297</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have a question regarding ls -l and du -s *&lt;BR /&gt;/home/&lt;MYDIR&gt;&lt;BR /&gt;&lt;BR /&gt;ls -l /home&lt;BR /&gt;&lt;BR /&gt;drwxr-xr-x   8 &lt;MYDIR&gt; users         1024 Apr&lt;BR /&gt;3 05:52 &lt;MYDIR&gt; &lt;BR /&gt;&lt;BR /&gt;du -s /home&lt;BR /&gt;&lt;BR /&gt;3796    &lt;MYDIR&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If I have to find the exact size of &lt;MYDIR&gt; in bytes/kb/mb (size of all files and its subdirectories ...) how should I know? Whats the difference between du -s * and ls -l. &lt;BR /&gt;&lt;BR /&gt;Please help&lt;BR /&gt;&lt;/MYDIR&gt;&lt;/MYDIR&gt;&lt;/MYDIR&gt;&lt;/MYDIR&gt;&lt;/MYDIR&gt;</description>
      <pubDate>Thu, 12 May 2005 10:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543352#M839297</guid>
      <dc:creator>Lee_110</dc:creator>
      <dc:date>2005-05-12T10:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543353#M839298</link>
      <description>The ls command is showing you the space occupied by the directory entry (which is a file itself).  The du command is summarizing the space occupied by the contents of the directory.  I generally prefer to run "du -sk" to give the output in KB.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 12 May 2005 10:23:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543353#M839298</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-05-12T10:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543354#M839299</link>
      <description>The du command gives the number of 512-byte blocks allocated for all&lt;BR /&gt;      files and (recursively) directories within each directory and file&lt;BR /&gt;      specified by the name operands. &lt;BR /&gt;&lt;BR /&gt;This is what you want - Kbytes:&lt;BR /&gt;&lt;BR /&gt;du -sk /home/&lt;MYDIR&gt;&lt;BR /&gt;&lt;BR /&gt;ls justs list the contents...you could use an awk script to total - but why bother...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;/MYDIR&gt;</description>
      <pubDate>Thu, 12 May 2005 10:27:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543354#M839299</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-05-12T10:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543355#M839300</link>
      <description>The two commands serve entirely different purposes. Ls is really geared towards providing information about an individual file (although obviously it will list entire directories). For example your ls -l indicates a size of 1024 bytes for /home. This refers to the size of the directory itself --- not the files underneath it. Du -s displays a summary total of the files including subdirectories and is generally better suited tto your task. Note that du displays its sizes in 512-byte block (or 1k if you add the -k option).&lt;BR /&gt;&lt;BR /&gt;Now, when you say you want the exact size that becomes more tricky. &lt;BR /&gt;&lt;BR /&gt;It's possible to create "sparse" files. For example, suppose you create a file and seek out to offset 1000000 before writing anything. &lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;mkdir /var/tmp/mydir&lt;BR /&gt;cd /var/tmp/mydir&lt;BR /&gt;dd if=/dev/zero bs=1 oseek=999999 count=1 of=mydir&lt;BR /&gt;&lt;BR /&gt;This will create a 1000000 byte file that only uses 1 byte of disk storage (actually 1 block). In this case what is the "true" size. I suggest you run this comand and examine it with both ls -l and du -k. You will get very different results. Which is correct? Both are because they are looking at different things.&lt;BR /&gt;&lt;BR /&gt;If sparse files are heavily used in a filesystem, it is possible to have the total size of the files (as reported by ls -l) much larger than the total size of the filesystem itself.&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2005 10:28:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543355#M839300</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-05-12T10:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543356#M839301</link>
      <description>Keep it simple, just use the -k option to show the disk usage in kilobytes ...&lt;BR /&gt;# du -sk &lt;DIR&gt;&lt;/DIR&gt;</description>
      <pubDate>Thu, 12 May 2005 11:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543356#M839301</guid>
      <dc:creator>Dani Seely</dc:creator>
      <dc:date>2005-05-12T11:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543357#M839302</link>
      <description>If you have subdirectories in your filesystems such as:&lt;BR /&gt;/dev/vg01/lvol1  /home&lt;BR /&gt;/dev/vg01/lvol2 /home/matthew&lt;BR /&gt;/dev/vg01/lvol3 /home/matthew/emc&lt;BR /&gt;&lt;BR /&gt;and you are sitting in /home and don't want the rest to show up use -x option:&lt;BR /&gt;&lt;BR /&gt;du -x .|sort -nr|more&lt;BR /&gt;&lt;BR /&gt;Matthew from Boston</description>
      <pubDate>Fri, 13 May 2005 08:11:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543357#M839302</guid>
      <dc:creator>Matthew Ghofrani</dc:creator>
      <dc:date>2005-05-13T08:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: ls -l du</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543358#M839303</link>
      <description>Hi Lee,&lt;BR /&gt;&lt;BR /&gt;ls(short list)&lt;BR /&gt;du (disk usage)&lt;BR /&gt;&lt;BR /&gt;when you use ls -l need some manipulation&lt;BR /&gt;with awk...On the other hand,trying to get&lt;BR /&gt;exact size of your dir than you can use&lt;BR /&gt;du -ks. -k option means kbytes&lt;BR /&gt;i usually use du -ks &lt;MYDIR_PATH&gt; *|sort -n&lt;BR /&gt;and gets what i need...&lt;BR /&gt;&lt;BR /&gt;Good Luck,&lt;/MYDIR_PATH&gt;</description>
      <pubDate>Mon, 16 May 2005 09:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ls-l-du/m-p/3543358#M839303</guid>
      <dc:creator>Cem Tugrul</dc:creator>
      <dc:date>2005-05-16T09:27:18Z</dc:date>
    </item>
  </channel>
</rss>

