<?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: sort files by size in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797189#M41649</link>
    <description>For a directory tree listing do&lt;BR /&gt;&lt;BR /&gt;$ dir/size [...]/nohead/wid=(filename=90,size=8)/out=space.txt&lt;BR /&gt;$ sort space.txt space.txt/key=(position:92,size:9,desc)&lt;BR /&gt;</description>
    <pubDate>Thu, 09 Jun 2011 07:07:03 GMT</pubDate>
    <dc:creator>Mark Battle</dc:creator>
    <dc:date>2011-06-09T07:07:03Z</dc:date>
    <item>
      <title>sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797187#M41647</link>
      <description>hello&lt;BR /&gt;please, simple question.&lt;BR /&gt;How to sort files in the directory by size.&lt;BR /&gt;&lt;BR /&gt;Here is an example.&lt;BR /&gt;Whats wrong?&lt;BR /&gt;&lt;BR /&gt;=============================================&lt;BR /&gt;&lt;BR /&gt;$ if p1 .eqs. "" then $ p1 = "*.*"&lt;BR /&gt;&lt;BR /&gt;$ close /nolog outfile&lt;BR /&gt;$ open /write outfile sys$manager:x.x&lt;BR /&gt;$ loop:&lt;BR /&gt;$       file = f$search( p1 )&lt;BR /&gt;$       if file .eqs. "" then $ goto done&lt;BR /&gt;$       cdt = f$file_attributes( file, "EOF" )&lt;BR /&gt;$!       cdt = f$cvtime( cdt, "COMPARISON" )&lt;BR /&gt;$       write outfile -&lt;BR /&gt;                cdt, -&lt;BR /&gt;                " ", -&lt;BR /&gt;                f$parse( file, , , "NAME" ),-&lt;BR /&gt;                f$parse( file, , , "TYPE" )&lt;BR /&gt;$ goto loop&lt;BR /&gt;$ done:&lt;BR /&gt;$ close outfile&lt;BR /&gt;$ sort sys$manager:x.x sys$manager:z.z /key = (position:1,decimal)&lt;BR /&gt;$ type sys$manager:z.z&lt;BR /&gt;$ delete sys$manager:x.x.,z.z.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2011 06:19:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797187#M41647</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2011-06-09T06:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797188#M41648</link>
      <description>SORT can't do 'variable length' keys (except floting point). You have to output the size in a fixed length field like:&lt;BR /&gt;$ size=f$fao("!8UL",cdt) &lt;BR /&gt;and then output size instead of cdt.&lt;BR /&gt;&lt;BR /&gt;The sort command then is&lt;BR /&gt;$ sort sys$scratch:x.x sys$scratch:z.z /key=(position:1,size:8,decimal)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2011 06:54:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797188#M41648</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2011-06-09T06:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797189#M41649</link>
      <description>For a directory tree listing do&lt;BR /&gt;&lt;BR /&gt;$ dir/size [...]/nohead/wid=(filename=90,size=8)/out=space.txt&lt;BR /&gt;$ sort space.txt space.txt/key=(position:92,size:9,desc)&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2011 07:07:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797189#M41649</guid>
      <dc:creator>Mark Battle</dc:creator>
      <dc:date>2011-06-09T07:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797190#M41650</link>
      <description>and without intermediate files:&lt;BR /&gt;&lt;BR /&gt;$ with bash shell: bash -c "ls -lS"&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;$ pipe direct/nohead/notrail/size/width=(DISPLAY=90,filename=80,size=9) 'p1' |-&lt;BR /&gt; sort/key=(position:82,size:10,descending) sys$pipe: sys$output | type sys$pipe:&lt;BR /&gt;&lt;BR /&gt;(assuming directory+filenames are not longer than 80, or extent the width).</description>
      <pubDate>Thu, 09 Jun 2011 07:29:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797190#M41650</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2011-06-09T07:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797191#M41651</link>
      <description>Hi Alex,&lt;BR /&gt;&lt;BR /&gt;Use QDSB, downloadable from&lt;BR /&gt;&lt;A href="http://www.quadratrix.be/qdsb.html" target="_blank"&gt;http://www.quadratrix.be/qdsb.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It's free.&lt;BR /&gt;&lt;BR /&gt;Greetz.&lt;BR /&gt;Kris (aka Qkcl)</description>
      <pubDate>Thu, 09 Jun 2011 07:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797191#M41651</guid>
      <dc:creator>Kris Clippeleyr</dc:creator>
      <dc:date>2011-06-09T07:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797192#M41652</link>
      <description>&amp;gt;$ with bash shell: bash -c "ls -lS"&lt;BR /&gt;&lt;BR /&gt;:)  with bash, so I'm unix administrator for ten last years....&lt;BR /&gt;&lt;BR /&gt;Unfortunately I have no practice with OpenVMS system administration, only for playing :(&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2011 08:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797192#M41652</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2011-06-09T08:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797193#M41653</link>
      <description>Thank you all</description>
      <pubDate>Thu, 09 Jun 2011 08:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797193#M41653</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2011-06-09T08:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797194#M41654</link>
      <description>Just my EUR .02...&lt;BR /&gt;&lt;BR /&gt;Whatever the OP wants to use P1 for and whatever the expected output should look like,&lt;BR /&gt;&lt;BR /&gt;$ bash -c "ls -lS" 'p1'&lt;BR /&gt;silently ignores the 'p1'&lt;BR /&gt;&lt;BR /&gt;$ bash -c "ls -lS ''p1'"&lt;BR /&gt;requires a Posix style path in P1&lt;BR /&gt;&lt;BR /&gt;and "ls -l" prints some noise. "ls -sS -c1" would come close, but the GNV version I tried seems to have problems to do the correct sort.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; $ pipe direct/nohead/notrail/size/width=(DISPLAY=90,filename=80,size=9) 'p1' |-&lt;BR /&gt;sort/key=(position:82,size:10,descending) sys$pipe: sys$output | type sys$pipe:&lt;BR /&gt;&lt;BR /&gt;The OP seems to want only names and types. You may want to add a /sel=file=(nodevice,nodir,novers)&lt;BR /&gt;The OP had the default sorting order ascending. Anyway, here I would just sort to sys$output and omit the trailing pipe. But I would add another key to sort the file names as well.</description>
      <pubDate>Thu, 09 Jun 2011 08:19:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797194#M41654</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2011-06-09T08:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797195#M41655</link>
      <description>[&lt;BR /&gt;The OP seems to want only names and types. You may want to add a /sel=file=(nodevice,nodir,novers)&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;But then P1 also should be restricted to one directory only, otherwise all files in different subdirectories are listed without indication which one is in which directory! &lt;BR /&gt;&lt;BR /&gt;Anyway a DIR &amp;amp; Sort script is not perfect,&lt;BR /&gt;Kris's QDSB is superior.</description>
      <pubDate>Thu, 09 Jun 2011 11:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797195#M41655</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2011-06-09T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: sort files by size</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797196#M41656</link>
      <description>It is very interesting why DEC/Compaq/HP will not include very useful /SORT option into DIR&lt;BR /&gt;as DEC in RT-11 DCL had done?&lt;BR /&gt;Very strange.</description>
      <pubDate>Fri, 10 Jun 2011 07:43:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-files-by-size/m-p/4797196#M41656</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2011-06-10T07:43:57Z</dc:date>
    </item>
  </channel>
</rss>

