<?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: Perl with find in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051820#M96452</link>
    <description>Hi Coolmar,&lt;BR /&gt;&lt;BR /&gt;Why not just use the 'find' command?&lt;BR /&gt;&lt;BR /&gt;$ find /path -type f -mtime -1 -exec ls -l {} \;&lt;BR /&gt;&lt;BR /&gt;But if you are set on using that perl one-liner, change '1/48' to '1' for the last 24 hours.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Thu, 07 Jun 2007 13:11:28 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2007-06-07T13:11:28Z</dc:date>
    <item>
      <title>Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051819#M96451</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I found this one-liner on IRTC that James Ferguson came up with and it is very close to what I want.  I am trying to decipher it and learn perl but am short on time right now and need a solution.  It finds all files in a directory structure that have changed in the last 30 minutes.  I need it to print out the files (including datestamps like ls -l would) that have been created or modified in the last 24 hours.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;perl -MFile::Find -le 'find(sub{print $File::Find::name if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt; 1/48},".")'</description>
      <pubDate>Thu, 07 Jun 2007 12:50:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051819#M96451</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-07T12:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051820#M96452</link>
      <description>Hi Coolmar,&lt;BR /&gt;&lt;BR /&gt;Why not just use the 'find' command?&lt;BR /&gt;&lt;BR /&gt;$ find /path -type f -mtime -1 -exec ls -l {} \;&lt;BR /&gt;&lt;BR /&gt;But if you are set on using that perl one-liner, change '1/48' to '1' for the last 24 hours.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Thu, 07 Jun 2007 13:11:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051820#M96452</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-07T13:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051821#M96453</link>
      <description>Yeah, I was able to figure out the 1/48 to 1 but how do I print the output in ls -l format?</description>
      <pubDate>Thu, 07 Jun 2007 13:15:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051821#M96453</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-07T13:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051822#M96454</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;While I would agree with Spex for cases not involving fractional days, you could amend my snippet to something as simple as:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le 'find(sub{print join " ",$File::Find::name,scalar localtime((stat($_))[9]) if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt;= 1},".")' &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Jun 2007 13:19:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051822#M96454</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-07T13:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051823#M96455</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Actually it looks better if we print the timestamp first:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le 'find(sub{print join " ",scalar localtime((stat($_))[9]),$File::Find::name if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt;= 1},".")'   &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Jun 2007 13:23:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051823#M96455</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-07T13:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051824#M96456</link>
      <description>Thanks James!  That's perfect.</description>
      <pubDate>Thu, 07 Jun 2007 13:30:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051824#M96456</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-07T13:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051825#M96457</link>
      <description>The key to what you are trying to do is the stat() function which returns file mode, uid, gid, size, times, number of links, ,,, . The times returned by stat() are in epoch seconds so that you need localtime() or strftime() to format them into more readable time values. You also need getpwuid() and getpwgid() to translate the UID's and GID's. Essentially, you are going to replace the sub(print) with a function that does the printing.&lt;BR /&gt;&lt;BR /&gt;Do a man perlfuncs and a man File::Find and you should be in business. &lt;BR /&gt;&lt;BR /&gt;It really does you no favors to fully code the solution for you but you have enough pieces to put it together.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jun 2007 13:31:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051825#M96457</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-06-07T13:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Perl with find</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051826#M96458</link>
      <description>Thanks Clay...that gives me alot to start with.</description>
      <pubDate>Thu, 07 Jun 2007 13:34:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-with-find/m-p/5051826#M96458</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-06-07T13:34:57Z</dc:date>
    </item>
  </channel>
</rss>

