<?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: listing files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541138#M369384</link>
    <description>Hi HImacs:&lt;BR /&gt;&lt;BR /&gt;Depending on your exact objectives, this might help:&lt;BR /&gt;&lt;BR /&gt;# ls | grep -Ev "[0-9]{6}"&lt;BR /&gt;&lt;BR /&gt;This will filter out files whose size is 6-digits in length if you do a long 'ls' listing, though (i.e. 'ls -l') so, this would correctly report files from that, too:&lt;BR /&gt;&lt;BR /&gt;# ls -l | awk '$NF!~/[0-9]{6}/'&lt;BR /&gt;&lt;BR /&gt;The assumption here is that a date that is part of the filename is exactly 6-digits long.  If you always use the format of "MMDDYYYY" as you suggest in your example, a better expression might be:&lt;BR /&gt;&lt;BR /&gt;ls -l | awk '$NF!~/[0-1][0-9][0-3][0-9][20][0-9][0-9]/'&lt;BR /&gt;&lt;BR /&gt;In this case, the YYYY portion is assumed to be the year 2000 or later.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 29 Nov 2009 17:45:02 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-11-29T17:45:02Z</dc:date>
    <item>
      <title>listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541130#M369376</link>
      <description>Hi admin,&lt;BR /&gt;&lt;BR /&gt;My directory contains lots of files including files appended with date.I want to list files with no date appended.For example i want to list only test.txt not text.txt.11112009&lt;BR /&gt;&lt;BR /&gt;Please suggest&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;himacs</description>
      <pubDate>Sun, 29 Nov 2009 09:07:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541130#M369376</guid>
      <dc:creator>himacs</dc:creator>
      <dc:date>2009-11-29T09:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541131#M369377</link>
      <description>Hi Himacs,&lt;BR /&gt;&lt;BR /&gt;If all files in that directory contains 2009 then you can try this:&lt;BR /&gt;&lt;BR /&gt;# ll | grep -v 2009*&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any exceptions.&lt;BR /&gt;&lt;BR /&gt;Regds..</description>
      <pubDate>Sun, 29 Nov 2009 09:23:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541131#M369377</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2009-11-29T09:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541132#M369378</link>
      <description>the "awk" command may help you.</description>
      <pubDate>Sun, 29 Nov 2009 09:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541132#M369378</guid>
      <dc:creator>chendan_1</dc:creator>
      <dc:date>2009-11-29T09:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541133#M369379</link>
      <description>This would remove any filenames from your listing which end on 6 or more digits&lt;BR /&gt;&lt;BR /&gt;ls | perl -ne 'print if (!/\d{6}\d*$/)'&lt;BR /&gt;&lt;BR /&gt;cheers</description>
      <pubDate>Sun, 29 Nov 2009 13:30:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541133#M369379</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2009-11-29T13:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541134#M369380</link>
      <description>Sorry, seems I misread the question.&lt;BR /&gt;&lt;BR /&gt;ls | sed 's/\(.*\)[0-9][0-9][0-9][0-9][0-9][0-9][0-9]*$/\1/'&lt;BR /&gt;&lt;BR /&gt;would chop off the digits at the end, if 6 or more.</description>
      <pubDate>Sun, 29 Nov 2009 13:34:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541134#M369380</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2009-11-29T13:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541135#M369381</link>
      <description>and this should do the same&lt;BR /&gt;&lt;BR /&gt;perl -ne 's/(.*)[^0-9][0-9]{6}[0-9]*$/\1/; print;'</description>
      <pubDate>Sun, 29 Nov 2009 13:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541135#M369381</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2009-11-29T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541136#M369382</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If its a single directiory then do "ls -lrt" and you will get the files with sorted date recent modify at last.&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Sun, 29 Nov 2009 15:05:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541136#M369382</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-11-29T15:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541137#M369383</link>
      <description>What happens if you just do a &lt;BR /&gt;&lt;BR /&gt;# ll *.txt&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 29 Nov 2009 17:07:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541137#M369383</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2009-11-29T17:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541138#M369384</link>
      <description>Hi HImacs:&lt;BR /&gt;&lt;BR /&gt;Depending on your exact objectives, this might help:&lt;BR /&gt;&lt;BR /&gt;# ls | grep -Ev "[0-9]{6}"&lt;BR /&gt;&lt;BR /&gt;This will filter out files whose size is 6-digits in length if you do a long 'ls' listing, though (i.e. 'ls -l') so, this would correctly report files from that, too:&lt;BR /&gt;&lt;BR /&gt;# ls -l | awk '$NF!~/[0-9]{6}/'&lt;BR /&gt;&lt;BR /&gt;The assumption here is that a date that is part of the filename is exactly 6-digits long.  If you always use the format of "MMDDYYYY" as you suggest in your example, a better expression might be:&lt;BR /&gt;&lt;BR /&gt;ls -l | awk '$NF!~/[0-1][0-9][0-3][0-9][20][0-9][0-9]/'&lt;BR /&gt;&lt;BR /&gt;In this case, the YYYY portion is assumed to be the year 2000 or later.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 29 Nov 2009 17:45:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541138#M369384</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-29T17:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541139#M369385</link>
      <description>&amp;gt;I want to list only test.txt not text.txt.11112009&lt;BR /&gt;&lt;BR /&gt;Then exclude that pattern:&lt;BR /&gt;ls !(*.[01][0-9][0-3][0-9][12][0-9][0-9][0-9])&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: You probably didn't want [20]:&lt;BR /&gt;ll | awk '$NF !~ /[0-1][0-9][0-3][0-9]20[0-9][0-9]/'</description>
      <pubDate>Mon, 30 Nov 2009 09:26:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541139#M369385</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-30T09:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541140#M369386</link>
      <description>Hi himacs,&lt;BR /&gt;this should run (I'm not able to test it now):&lt;BR /&gt;ls -l !(*.*2009*)&lt;BR /&gt;&lt;BR /&gt;this will excluse all file with 2009 in the suffix&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Mon, 30 Nov 2009 11:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541140#M369386</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-11-30T11:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: listing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541141#M369387</link>
      <description>@Arturo&lt;BR /&gt;&lt;BR /&gt;# ls -l !(*.*2009*) &amp;lt;&amp;lt;== Works good</description>
      <pubDate>Mon, 30 Nov 2009 12:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/listing-files/m-p/4541141#M369387</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2009-11-30T12:40:28Z</dc:date>
    </item>
  </channel>
</rss>

