Berkeley CSUA MOTD:Entry 18709
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2000/7/18-19 [Computer/SW/Languages/Perl] UID:18709 Activity:very high
7/18    Anyone have a perl one liner to list all the files less than an
        hour old in a directory?
        \_  man perl.
        \_ perl -MFile::Find -e'find(sub{print if (-M _)*24<1},".")' --pld
        \_ perl -e 'system("man find");'
        subday granularity short of using the "newer" switches. in pl you
        can do something like:
        \_ ls -altr | tail -50 | more | eyeballs
           \_ eyeballs: Command not found.
                \_ Eyeballs was part of my standard install.
                   \_ mine too, but then I got owned through an exploit of
                      a hole in libchernobyl 0.1, and the bastards deleted
                      it. can you send me a copy?
                        \_ Sorry.  License violation.  You'll have to
                           reinstall.  They're not open source.
                           \_ AW FUCK!
           \_ i dont think there is a simple way to use find to get
              subday granularity short of using the "newer" switches. in pl
              you can do something like:
              $ageday = (-M $FILE_TO_STAT);
              $agehrs = $ageday * 24;
              $agemin = $agehrs * 60;
              $agesec = $agemin * 60;
                                        --psb
              \_ psbesque formatting fixed. -motd formatting demigod
                \_ i used to have a lot of respect for psb. it's all gone now
                \_ Watch it buddy!  Don't dis the psb formatting --psb #1 Fan
        \_ I like 'newer' switches.
        \_ so a one-liner would look like, eg:
           perl -e 'while(<{.,}*>) { print "$_\n" if (-M)<1/24; }'
           [psb, answer the question]
        \_ or perl -e 'system ( "find . -mmin 60" );'
                                        \-boy i somehow missed the -mmin
                                        flag. i stand corrected. however it
                                        should be -mmin -60 with gnu find.--psb