<?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: finding and removing a file that ends in .&amp;lt;number&amp;gt; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562161#M226711</link>
    <description>Superb!&lt;BR /&gt;Clay, Rick thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Both worked and as you suggested Rick, Clays hits it on the spot!!&lt;BR /&gt;THANKS!!! and such prompt response too!!!</description>
    <pubDate>Fri, 10 Jun 2005 15:24:00 GMT</pubDate>
    <dc:creator>Vic S. Kelan</dc:creator>
    <dc:date>2005-06-10T15:24:00Z</dc:date>
    <item>
      <title>finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562156#M226706</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to search for and delete files ending in a *.&lt;NUMBER&gt;.&lt;BR /&gt;&lt;BR /&gt;For example test.3457, test.1233&lt;BR /&gt;&lt;BR /&gt;find / -name 'test.*' -exec rm -f {} \;&lt;BR /&gt;would take out all files with test.* including files such as test.dontdelete for example. I want to restrict this to only .&lt;NUMERALS&gt;&lt;BR /&gt;&lt;BR /&gt;Any script I can use for this kind of task available or can find do this somehow?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/NUMERALS&gt;&lt;/NUMBER&gt;</description>
      <pubDate>Fri, 10 Jun 2005 14:52:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562156#M226706</guid>
      <dc:creator>Vic S. Kelan</dc:creator>
      <dc:date>2005-06-10T14:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562157#M226707</link>
      <description>You can change the -print function to the -exec rm {}\;&lt;BR /&gt;&lt;BR /&gt;This will list the files so you can be sure you want to remove them.&lt;BR /&gt;&lt;BR /&gt;find / -name "*.[0-9]" -print</description>
      <pubDate>Fri, 10 Jun 2005 14:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562157#M226707</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-06-10T14:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562158#M226708</link>
      <description>find . -type f -name 'test.*' | grep -E -e '.*\.[0-9]*$' | while read FNAME&lt;BR /&gt;  do&lt;BR /&gt;     echo "${FNAME}"&lt;BR /&gt;#    rm ${FNAME}&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Uncomment the rm when you are confident.</description>
      <pubDate>Fri, 10 Jun 2005 15:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562158#M226708</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-10T15:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562159#M226709</link>
      <description>1 thing I just noticed, this will only find those files with 1 numerical digit at the end. &lt;BR /&gt;&lt;BR /&gt;The files you are wanting, do they all end in 4 digits? In which case,&lt;BR /&gt;&lt;BR /&gt;find / -name "*.[0-9][0-9][0-9][0-9]" -print</description>
      <pubDate>Fri, 10 Jun 2005 15:03:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562159#M226709</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-06-10T15:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562160#M226710</link>
      <description>Clay has better solution...</description>
      <pubDate>Fri, 10 Jun 2005 15:05:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562160#M226710</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-06-10T15:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562161#M226711</link>
      <description>Superb!&lt;BR /&gt;Clay, Rick thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Both worked and as you suggested Rick, Clays hits it on the spot!!&lt;BR /&gt;THANKS!!! and such prompt response too!!!</description>
      <pubDate>Fri, 10 Jun 2005 15:24:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562161#M226711</guid>
      <dc:creator>Vic S. Kelan</dc:creator>
      <dc:date>2005-06-10T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562162#M226712</link>
      <description>Actually, I didn't quite get it right because I would also match on any file that ends in simply "." because I am matching zero or more digits but what I should have matches was one or more digits:&lt;BR /&gt;&lt;BR /&gt;WRONG: !!!!&lt;BR /&gt;find . -type f -name 'test.*' | grep -E -e '.*\.[0-9]*$' | while read FNAME&lt;BR /&gt;do&lt;BR /&gt;echo "${FNAME}"&lt;BR /&gt;# rm ${FNAME}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;RIGHT:&lt;BR /&gt;find . -type f -name 'test.*' | grep -E -e '.*\.[0-9]+$' | while read FNAME&lt;BR /&gt;do&lt;BR /&gt;echo "${FNAME}"&lt;BR /&gt;# rm ${FNAME}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Note the change from '*' to '+' -- not that I'm nit-picky.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Jun 2005 14:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562162#M226712</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-12T14:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562163#M226713</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;find / -name "test.[0-9]*" | xargs rm -f&lt;BR /&gt;&lt;BR /&gt;-exec rm -f {} will make problem when file count is increased. You can use xargs to avoid that.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Sun, 12 Jun 2005 23:35:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562163#M226713</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-06-12T23:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: finding and removing a file that ends in .&lt;number&gt;</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562164#M226714</link>
      <description>If the file count is large, then you can use +(plus) delimiter instead of ;(semicolon) for -exec. &lt;BR /&gt;&lt;BR /&gt;find . &lt;SEARCH_OPTION&gt; -exec rm -f {} \+&lt;BR /&gt;&lt;BR /&gt;This will accumulate all the file names and will call 'rm -f' only once at the end. Same as xargs. However if the command line goes beyond a limit size, find would break it into multiple commands and execute them intelligently. &lt;BR /&gt;&lt;BR /&gt;-Amit&lt;/SEARCH_OPTION&gt;</description>
      <pubDate>Mon, 13 Jun 2005 00:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/finding-and-removing-a-file-that-ends-in-lt-number-gt/m-p/3562164#M226714</guid>
      <dc:creator>Amit Agarwal_1</dc:creator>
      <dc:date>2005-06-13T00:08:14Z</dc:date>
    </item>
  </channel>
</rss>

