Need to find all the docments created in the past week

Discussion in 'all things UNIX' started by Riverrun, Jan 21, 2010.

Thread Status:
Not open for further replies.
  1. Riverrun

    Riverrun Registered Member

    Joined:
    Feb 19, 2007
    Posts:
    376
    Location:
    ~
    I need to find all the documents created in the past week(.txt &.odt). I presume some variation of the Grep command will do the job nicely but I'm unable totailor it myself.

    Could someone here be kind enough to do it for me?
     
  2. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
    This seems to work. Just tried it in my Download folder to see what changed since 13 Jan. Can't vouch for accuracy but it seems correct.

    ~/Downloads$ touch -d "13 jan 2010" date_marker
    ~/Downloads$ find . -newer date_marker
    .
    ./clamtk
    ./Old Jaunty Libsane
    ./Old Jaunty Libsane /libsane_1.0.19-23ubuntu7_amd64.deb
    ~/Downloads$
     
  3. Riverrun

    Riverrun Registered Member

    Joined:
    Feb 19, 2007
    Posts:
    376
    Location:
    ~
    TY Ocky
     
  4. dan_maran

    dan_maran Registered Member

    Joined:
    Aug 30, 2004
    Posts:
    1,053
    Location:
    Stamford, CT
    Here's a starting point:
    Code:
    ls -al  | egrep 2010-01-'(1[8-9]|2[0-2])'
    Or just use the one Ocky mentioned from the cookbook, =)
     
    Last edited: Jan 21, 2010
Loading...
Thread Status:
Not open for further replies.