<?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 files in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127494#M93061</link>
    <description>I Thank you all very much.&lt;BR /&gt;I will check it.</description>
    <pubDate>Fri, 11 Jan 2008 15:11:50 GMT</pubDate>
    <dc:creator>Nagaraj Kris</dc:creator>
    <dc:date>2008-01-11T15:11:50Z</dc:date>
    <item>
      <title>finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127486#M93053</link>
      <description>I have a situation where i have to find files in a directory /home/test which is created 1 hour before excluding filenames starts with abc* and if found i have to notify through email.&lt;BR /&gt;This should be checked for every hour&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 18:56:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127486#M93053</guid>
      <dc:creator>Nagaraj Kris</dc:creator>
      <dc:date>2008-01-10T18:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127487#M93054</link>
      <description>Something basic.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ls /mydir/abc* &amp;gt; /dev/null&lt;BR /&gt;if [[ $? -eq 0 ]]&lt;BR /&gt;then&lt;BR /&gt;    echo "abc files found - `date`"|mailx -m -s "File Alert" somebody@there.com&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 20:50:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127487#M93054</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-01-10T20:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127488#M93055</link>
      <description>hmmm.... &lt;BR /&gt;&lt;BR /&gt;the 1 hour requirement means you're going to have to use "touch" to set a dummy file's time to 1 hour before current time, then use "find -newer" to find the files.  Once you've got the list you can exclude what you want.&lt;BR /&gt;&lt;BR /&gt;"man touch", "man find" and search HP forum with "find newer" for more info</description>
      <pubDate>Thu, 10 Jan 2008 20:58:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127488#M93055</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-10T20:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127489#M93056</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you are looking for files modifed in the last hour, use Perl:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le 'find(sub{print if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt; (1/24) &amp;amp;&amp;amp; m/^abc/},"/home/test")'&lt;BR /&gt;&lt;BR /&gt;This finds files in the specified directory that are 1/24 of a day (one hour) or less in age.  This age is the *modification* age of the file.  There is no such thing as a "creation" timestamp in Unix.&lt;BR /&gt;&lt;BR /&gt;If you would like to use pure shell:&lt;BR /&gt;&lt;BR /&gt;# touch -amt 01101530 /tmp/myref&lt;BR /&gt;# find /home/myref -type f -newer /tmp/myref -name "abc*"&lt;BR /&gt;&lt;BR /&gt;Of course, the "problem" in the shell solution is that you have to perform a touch of a reference file to create the one-hour delta everytime you want to search!  The Perl solution obviates that.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 21:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127489#M93056</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-10T21:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127490#M93057</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;You got nice advice about Perl and&lt;BR /&gt;standard grep options.&lt;BR /&gt;&lt;BR /&gt;As always, Unix tools offer such a wide variety of solutions. That is the&lt;BR /&gt;power of having freedom to chose the&lt;BR /&gt;one that suites you :)&lt;BR /&gt;&lt;BR /&gt;If I understand your request correctly,&lt;BR /&gt;you want to EXCLUDE filenames that start&lt;BR /&gt;with "abc" string.&lt;BR /&gt;&lt;BR /&gt;If you use GNU grep (much more&lt;BR /&gt;powerful that standard grep),&lt;BR /&gt;it is very easy. An example (line is&lt;BR /&gt;wrapped for readability purpose):&lt;BR /&gt;&lt;BR /&gt;find /home/test -type f ! -name 'abc*' \&lt;BR /&gt;-cmin -60 -exec ls -als {} \; 2&amp;gt;/dev/null | \&lt;BR /&gt;mailx -s "SUMMARY: New abc files" username&lt;BR /&gt;&lt;BR /&gt;Explanation about "-amin", "-cmin" and&lt;BR /&gt;"-mmin" flag arguments:&lt;BR /&gt;&lt;BR /&gt;+n   for greater than n&lt;BR /&gt;-n   for less than n&lt;BR /&gt;n    for exactly n&lt;BR /&gt;&lt;BR /&gt;So...&lt;BR /&gt;&lt;BR /&gt;"-cmin 60" means status changed EXACTLY&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;"-cmin -60" means status changed LESS THAN&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;"-cmin 60" means status changed MORE THAN&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Thu, 10 Jan 2008 23:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127490#M93057</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-01-10T23:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127491#M93058</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;You got nice advice about Perl and&lt;BR /&gt;standard find options.&lt;BR /&gt;&lt;BR /&gt;As always, Unix tools offer such a wide variety of solutions. That is the&lt;BR /&gt;power of having freedom to chose the&lt;BR /&gt;one that suites you :)&lt;BR /&gt;&lt;BR /&gt;If I understand your request correctly,&lt;BR /&gt;you want to EXCLUDE filenames that start&lt;BR /&gt;with "abc" string.&lt;BR /&gt;&lt;BR /&gt;If you use GNU find (much more&lt;BR /&gt;powerful that standard grep),&lt;BR /&gt;it is very easy. An example (line is&lt;BR /&gt;wrapped for readability purpose):&lt;BR /&gt;&lt;BR /&gt;find /home/test -type f ! -name 'abc*' \&lt;BR /&gt;-cmin -60 -exec ls -als {} \; 2&amp;gt;/dev/null | \&lt;BR /&gt;mailx -s "SUMMARY: New abc files" username&lt;BR /&gt;&lt;BR /&gt;Explanation about "-amin", "-cmin" and&lt;BR /&gt;"-mmin" flag arguments:&lt;BR /&gt;&lt;BR /&gt;+n   for greater than n&lt;BR /&gt;-n   for less than n&lt;BR /&gt;n    for exactly n&lt;BR /&gt;&lt;BR /&gt;So...&lt;BR /&gt;&lt;BR /&gt;"-cmin 60" means status changed EXACTLY&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;"-cmin -60" means status changed LESS THAN&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;"-cmin 60" means status changed MORE THAN&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Thu, 10 Jan 2008 23:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127491#M93058</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-01-10T23:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127492#M93059</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Oops, you want to EXCLUDE files beginning with the string "abc".  Hence in either the Perl or the shell, we negate (!) the name matching:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le 'find(sub{print if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt; (1/24) &amp;amp;&amp;amp; $_ !~m/^abc/},"/home/test")'&lt;BR /&gt;&lt;BR /&gt;# find /home/test -type f -newer /tmp/myref ! -name "abc*"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Jan 2008 23:54:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127492#M93059</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-10T23:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127493#M93060</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Like James, I also made a typing error :)&lt;BR /&gt;I must be getting old and absent minded...&lt;BR /&gt;&lt;BR /&gt;This is correct explanation:&lt;BR /&gt;&lt;BR /&gt;"-cmin +60" means status changed MORE THAN&lt;BR /&gt;60 minutes ago&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Fri, 11 Jan 2008 00:43:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127493#M93060</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-01-11T00:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: finding files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127494#M93061</link>
      <description>I Thank you all very much.&lt;BR /&gt;I will check it.</description>
      <pubDate>Fri, 11 Jan 2008 15:11:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/finding-files/m-p/4127494#M93061</guid>
      <dc:creator>Nagaraj Kris</dc:creator>
      <dc:date>2008-01-11T15:11:50Z</dc:date>
    </item>
  </channel>
</rss>

