<?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: moving files by date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490348#M801451</link>
    <description>Thanks for the help!  I used James suggestion (Curtis, not that your's wouldn't work, but James' was shorter :) )  Thanks.  It saved me a lot of time.</description>
    <pubDate>Tue, 06 Feb 2001 21:58:18 GMT</pubDate>
    <dc:creator>Mark Vollmers</dc:creator>
    <dc:date>2001-02-06T21:58:18Z</dc:date>
    <item>
      <title>moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490344#M801447</link>
      <description>I have a folder with a very large number of files in it.  I need to go through that and move all of the files that were created from a certain date on (say 1-19-01) to another folder.  What is the easiest way to do this?  I can't find anything for mv that talks about moving by date, and I would really hate to list them and move individually (or even in handfuls).  There could be several hundred files or more.  Thanks in advance!</description>
      <pubDate>Tue, 06 Feb 2001 19:54:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490344#M801447</guid>
      <dc:creator>Mark Vollmers</dc:creator>
      <dc:date>2001-02-06T19:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490345#M801448</link>
      <description>how about trying this:&lt;BR /&gt;&lt;BR /&gt;here=/tmp/test&lt;BR /&gt;there=/tmp/test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for month in Jan Feb # etc&lt;BR /&gt;do&lt;BR /&gt;    (( day = 0 ))&lt;BR /&gt;    while (( $day &amp;lt; 31 ))&lt;BR /&gt;    do&lt;BR /&gt;        (( $day = $day + 1 ))&lt;BR /&gt;        [ ! -d $there/${month}.${day} ] &amp;amp;&amp;amp; mkdir $there/${month}.${day}&lt;BR /&gt;        there=$there/${month}.${day}&lt;BR /&gt;&lt;BR /&gt;        ll $here | tr -s '[:space:]' | awk "/$month $day/"'{print $NF;}' |&lt;BR /&gt;        while read file&lt;BR /&gt;        do&lt;BR /&gt;            mv $here/$file $there/&lt;BR /&gt;        done&lt;BR /&gt;    done&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Feb 2001 20:24:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490345#M801448</guid>
      <dc:creator>Curtis Larson</dc:creator>
      <dc:date>2001-02-06T20:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490346#M801449</link>
      <description>Hi Mark:&lt;BR /&gt;&lt;BR /&gt;Use the 'find' command with the 'newer' option and a "reference file" that you specify with the date and time transition:&lt;BR /&gt;&lt;BR /&gt;# cd &lt;SOURCE_DIR&gt;&lt;BR /&gt;# touch -mt myfile &lt;MMDDHHMM&gt;&lt;BR /&gt;# find . ! -newer myfile -exec mv {} &lt;DEST_DIR&gt; \;&lt;BR /&gt;&lt;BR /&gt;See the man pages for 'find'.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/DEST_DIR&gt;&lt;/MMDDHHMM&gt;&lt;/SOURCE_DIR&gt;</description>
      <pubDate>Tue, 06 Feb 2001 20:32:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490346#M801449</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-06T20:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490347#M801450</link>
      <description>probably want to add:&lt;BR /&gt;&lt;BR /&gt;[ -f $file ] &amp;amp;&amp;amp; mv $here/$file $there/ &lt;BR /&gt;&lt;BR /&gt;so you don't affect directories and such</description>
      <pubDate>Tue, 06 Feb 2001 20:38:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490347#M801450</guid>
      <dc:creator>Curtis Larson</dc:creator>
      <dc:date>2001-02-06T20:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490348#M801451</link>
      <description>Thanks for the help!  I used James suggestion (Curtis, not that your's wouldn't work, but James' was shorter :) )  Thanks.  It saved me a lot of time.</description>
      <pubDate>Tue, 06 Feb 2001 21:58:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490348#M801451</guid>
      <dc:creator>Mark Vollmers</dc:creator>
      <dc:date>2001-02-06T21:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: moving files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490349#M801452</link>
      <description>Hi Mark (again):&lt;BR /&gt;&lt;BR /&gt;A postscript (pun intended).&lt;BR /&gt;&lt;BR /&gt;'find' is intended to descend a directory structure.  In some cases, you may want to limit this action.  For instance, if you had subdirectories and files therein, upon which you did not want 'find' to operate, you could add the &lt;PRUNE&gt; and &lt;TYPE&gt; options to the syntax I presented above.  Thus:&lt;BR /&gt;&lt;BR /&gt;# find . ! -newer myfile -prune -type f -exec mv {} &lt;DEST_DIR&gt; \; &lt;BR /&gt;&lt;BR /&gt;The "-type f" selects only regular files; not directories, etc.  The "-prune" keeps 'find' from examining the contents of the subdirectory in the first place.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/DEST_DIR&gt;&lt;/TYPE&gt;&lt;/PRUNE&gt;</description>
      <pubDate>Wed, 07 Feb 2001 21:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files-by-date/m-p/2490349#M801452</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-07T21:10:10Z</dc:date>
    </item>
  </channel>
</rss>

