<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679539#M245142</link>
    <description>Hi,&lt;BR /&gt;This is not an ls -l output. This is an output from omnidb command.&lt;BR /&gt;&lt;BR /&gt;My requirement is to sort the lines using date field and the date happens to be in field 5 in first two lines and field 6 in last line in the above sample becuase the size of the file is in GB. &lt;BR /&gt;&lt;BR /&gt;The real file has lot of entries and the date appears only in feild 5 and field 6.</description>
    <pubDate>Sun, 27 Nov 2005 23:20:09 GMT</pubDate>
    <dc:creator>javedk</dc:creator>
    <dc:date>2005-11-27T23:20:09Z</dc:date>
    <item>
      <title>sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679534#M245137</link>
      <description>I am trying to sort the following lines with date filed. The issue I am facing is that some of the lines date is 5th field and some it's 6th. Could some one tell me how I can do a sort in this case.&lt;BR /&gt;&lt;BR /&gt;rw-r--r--  cma dba  2217912320 10/29/05 10:39:10 Oct_29_2005_1010.tar&lt;BR /&gt;-rw-r--r-- cma dba  183522816 11/05/05 22:51:18 Nov_5_2005_2250.tar&lt;BR /&gt;-rw-r--r-- cma dba  0.553 Gb 06/22/05 23:34:35 Jun_22_2005_2330.tar&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Nov 2005 04:30:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679534#M245137</guid>
      <dc:creator>javedk</dc:creator>
      <dc:date>2005-11-27T04:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679535#M245138</link>
      <description>Hi&lt;BR /&gt;try this:&lt;BR /&gt;#ll -t&lt;BR /&gt;:-)&lt;BR /&gt;or&lt;BR /&gt;|awk '{print $(NF-2)" "$(NF-1)" "$0}' |sort -n&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Sun, 27 Nov 2005 05:44:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679535#M245138</guid>
      <dc:creator>LiPEnS</dc:creator>
      <dc:date>2005-11-27T05:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679536#M245139</link>
      <description>Hi,&lt;BR /&gt;Use #ls -lrt&lt;BR /&gt;This will list the files with date and time sorted in ascending order&lt;BR /&gt;Regards,&lt;BR /&gt;Sunil</description>
      <pubDate>Sun, 27 Nov 2005 10:30:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679536#M245139</guid>
      <dc:creator>Sยภเl Kย๓คг</dc:creator>
      <dc:date>2005-11-27T10:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679537#M245140</link>
      <description>The standard Unix ls -l will show the time in detail up to about a year and then it switches to a less detailed date. However, the -t option will sort the ls -l output correctly with no need to use sort. Use -r to reverse the sort direction from newst first to oldest first.</description>
      <pubDate>Sun, 27 Nov 2005 12:53:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679537#M245140</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-11-27T12:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679538#M245141</link>
      <description>Hi Javedk,&lt;BR /&gt;&lt;BR /&gt;You can use &lt;BR /&gt;&lt;BR /&gt;# ll -rt  , to get automatically sorted as per date/time.&lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Raj.</description>
      <pubDate>Sun, 27 Nov 2005 17:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679538#M245141</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-11-27T17:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679539#M245142</link>
      <description>Hi,&lt;BR /&gt;This is not an ls -l output. This is an output from omnidb command.&lt;BR /&gt;&lt;BR /&gt;My requirement is to sort the lines using date field and the date happens to be in field 5 in first two lines and field 6 in last line in the above sample becuase the size of the file is in GB. &lt;BR /&gt;&lt;BR /&gt;The real file has lot of entries and the date appears only in feild 5 and field 6.</description>
      <pubDate>Sun, 27 Nov 2005 23:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679539#M245142</guid>
      <dc:creator>javedk</dc:creator>
      <dc:date>2005-11-27T23:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679540#M245143</link>
      <description>Use like:&lt;BR /&gt;&lt;BR /&gt;sort -nk 5,6 file&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;# cat file1&lt;BR /&gt;rw-r--r-- cma dba 2217912320 10/29/05 10:39:10 Oct_29_2005_1010.tar&lt;BR /&gt;-rw-r--r-- cma dba 183522816 11/05/05 22:51:18 Nov_5_2005_2250.tar&lt;BR /&gt;rw-r--r-- cma dba 2217912320 10/25/05 10:39:10 Oct_29_2005_1010.tar&lt;BR /&gt;-rw-r--r-- cma dba 0.553 Gb 06/22/05 23:34:35 Jun_22_2005_2330.tar&lt;BR /&gt;-rw-r--r-- cma dba 0.553 Gb 03/22/05 23:34:35 Jun_22_2005_2330.tar&lt;BR /&gt;# sort -nk 5,6 file1&lt;BR /&gt;-rw-r--r-- cma dba 0.553 Gb 03/22/05 23:34:35 Jun_22_2005_2330.tar&lt;BR /&gt;-rw-r--r-- cma dba 0.553 Gb 06/22/05 23:34:35 Jun_22_2005_2330.tar&lt;BR /&gt;rw-r--r-- cma dba 2217912320 10/25/05 10:39:10 Oct_29_2005_1010.tar&lt;BR /&gt;rw-r--r-- cma dba 2217912320 10/29/05 10:39:10 Oct_29_2005_1010.tar&lt;BR /&gt;-rw-r--r-- cma dba 183522816 11/05/05 22:51:18 Nov_5_2005_2250.tar&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Mon, 28 Nov 2005 01:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679540#M245143</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-11-28T01:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679541#M245144</link>
      <description>cat file1 |awk '{printf $1" "$2" "$3" "$4; if (NF == 7) print " "$5" "$6" "$7; else print $5" "$6" "$7" "$8}'|sort -k 5,6&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 28 Nov 2005 01:29:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679541#M245144</guid>
      <dc:creator>LiPEnS</dc:creator>
      <dc:date>2005-11-28T01:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679542#M245145</link>
      <description>Thank LiPEns,&lt;BR /&gt;&lt;BR /&gt;It works great.&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Nov 2005 02:02:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679542#M245145</guid>
      <dc:creator>javedk</dc:creator>
      <dc:date>2005-11-28T02:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: sort</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679543#M245146</link>
      <description>Thanks LiPEns,&lt;BR /&gt;&lt;BR /&gt;It works great.&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Nov 2005 02:02:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sort/m-p/3679543#M245146</guid>
      <dc:creator>javedk</dc:creator>
      <dc:date>2005-11-28T02:02:57Z</dc:date>
    </item>
  </channel>
</rss>

