<?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: delete  files by date range in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051352#M745474</link>
    <description>if i am using the below command :&lt;BR /&gt;&lt;BR /&gt;find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish -exec mv {} /newdir \;&lt;BR /&gt;&lt;BR /&gt;then i add -name *.t here on the find command (without moving)&lt;BR /&gt;&lt;BR /&gt;find . -name *.t -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish \;&lt;BR /&gt;result : find: missing conjunction&lt;BR /&gt;&lt;BR /&gt;then i try this&lt;BR /&gt;find . \( -name *.t \) -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish \;&lt;BR /&gt;&lt;BR /&gt;result :&lt;BR /&gt;find: bad option OFAAAa00102.t&lt;BR /&gt;&lt;BR /&gt;please help. thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 12 Jun 2007 21:51:30 GMT</pubDate>
    <dc:creator>ng_7</dc:creator>
    <dc:date>2007-06-12T21:51:30Z</dc:date>
    <item>
      <title>delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051343#M745465</link>
      <description>hi, does anyone knows how to delete files by specifying the modify date range ? eg to delete file with modify date from 01/01/07 to 28/02/07 .&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Tue, 05 Jun 2007 23:26:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051343#M745465</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-05T23:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051344#M745466</link>
      <description>Yes, someone does.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1107387" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1107387&lt;/A&gt;</description>
      <pubDate>Tue, 05 Jun 2007 23:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051344#M745466</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-06-05T23:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051345#M745467</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;try this solution:&lt;BR /&gt;touch -t 0701010000 /tmp/start&lt;BR /&gt;touch -t 0702282359 /tmp/finish&lt;BR /&gt;find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish | xargs rm&lt;BR /&gt;&lt;BR /&gt;(this is based on one solution that JRF provided once)&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 06 Jun 2007 00:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051345#M745467</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-06-06T00:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051346#M745468</link>
      <description>thanks , these are the command i wanted. it works fine. and how about moving to another directory instead of removing it .&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Tue, 12 Jun 2007 06:11:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051346#M745468</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-12T06:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051347#M745469</link>
      <description>find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish -exec mv {} /newdir \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 12 Jun 2007 06:17:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051347#M745469</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2007-06-12T06:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051348#M745470</link>
      <description>&lt;!--!*#--&gt;&amp;gt;how about moving to another directory instead of removing it.&lt;BR /&gt;&lt;BR /&gt;You may have to execute a script so you can change the path:&lt;BR /&gt;find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish \&lt;BR /&gt;  -exec move_them_script {} +&lt;BR /&gt;&lt;BR /&gt;And the contents of move_them_script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;for file in "$@"; do&lt;BR /&gt;   echo mv $file new_path/&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Make sure it does what you want then you can remove "echo".&lt;BR /&gt;&lt;BR /&gt;If find returns a "small" amount of files you can do:&lt;BR /&gt;$ mv $(find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish) new_path</description>
      <pubDate>Tue, 12 Jun 2007 06:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051348#M745470</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-12T06:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051349#M745471</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;note, that Pete's and Dennis' wont preserve the directory structure the file was found but move it plain into the new directory.&lt;BR /&gt;So it may be, that filenames in different directories overwrite eachother.&lt;BR /&gt;&lt;BR /&gt;If this is a problem, you'll have to modify Dennis' script like this:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;for file; do&lt;BR /&gt;   np=new_path/${file%/*} &lt;BR /&gt;   [ -d $np ] || mkdir -p $np&lt;BR /&gt;   echo mv $file $np&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 12 Jun 2007 06:39:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051349#M745471</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-06-12T06:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051350#M745472</link>
      <description>hi, thanks, sorry, one more question :&lt;BR /&gt;&lt;BR /&gt;to move a specific file with a specific range of modified date to other directory.&lt;BR /&gt;eg : to move *.t with the modified date range from 01/01/07 to 28/02/07 to /newdir&lt;BR /&gt;&lt;BR /&gt;thank you very much</description>
      <pubDate>Tue, 12 Jun 2007 20:17:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051350#M745472</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-12T20:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051351#M745473</link>
      <description>simply add one more condition to your find:&lt;BR /&gt;-name '*.t'</description>
      <pubDate>Tue, 12 Jun 2007 20:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051351#M745473</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-12T20:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051352#M745474</link>
      <description>if i am using the below command :&lt;BR /&gt;&lt;BR /&gt;find . -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish -exec mv {} /newdir \;&lt;BR /&gt;&lt;BR /&gt;then i add -name *.t here on the find command (without moving)&lt;BR /&gt;&lt;BR /&gt;find . -name *.t -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish \;&lt;BR /&gt;result : find: missing conjunction&lt;BR /&gt;&lt;BR /&gt;then i try this&lt;BR /&gt;find . \( -name *.t \) -xdev -type f -newer /tmp/start -a ! -newer /tmp/finish \;&lt;BR /&gt;&lt;BR /&gt;result :&lt;BR /&gt;find: bad option OFAAAa00102.t&lt;BR /&gt;&lt;BR /&gt;please help. thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Jun 2007 21:51:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051352#M745474</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-12T21:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051353#M745475</link>
      <description>I did not say -name *.t; I said -name '*.t' -- that makes all the difference. You want find rather than the shell to act upon the '*' metacharacter and the quotes protect it from the shell. Punctuations count in UNIX.</description>
      <pubDate>Tue, 12 Jun 2007 21:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051353#M745475</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-12T21:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051354#M745476</link>
      <description>sorry, it is my mistake. and it works fine.&lt;BR /&gt;&lt;BR /&gt;thank you very much.</description>
      <pubDate>Tue, 12 Jun 2007 23:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051354#M745476</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-12T23:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: delete  files by date range</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051355#M745477</link>
      <description>thanks to all of you.</description>
      <pubDate>Tue, 12 Jun 2007 23:23:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-files-by-date-range/m-p/5051355#M745477</guid>
      <dc:creator>ng_7</dc:creator>
      <dc:date>2007-06-12T23:23:09Z</dc:date>
    </item>
  </channel>
</rss>

