Results 1 to 6 of 6
  1. #1

    Exclamation Deleting Files Between 2 Dates

    hi

    i have about 10.000 files in my hard drive

    i want to delete the files e.g. from 1 jan 2007 to 1 mar 2007

    how i can do that from SSH if that can happen ??

  2. #2
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    $ touch -d "Jan 1 2007" file.start
    $ touch -d "Mar 1 2007" file.end
    $ find / -daystart -newer file.start \! -daystart -newer file.end -exec rm {} \;

    You should probably test that excluding the -exec rm {} \;
    first as I didn't...
    Daved @ Lightwave Networking, LLC.
    AS1426 https:/www.lightwave.net
    Primary Bandwidth: EGIHosting (NLayer, NTT, HE, Cogent)
    Xen PV VPS Hosting

  3. #3
    amm good other ideas ?

  4. #4
    Join Date
    Apr 2003
    Location
    San Jose, CA.
    Posts
    1,624
    What's wrong with that?

  5. #5
    i couldn't understand that

  6. #6
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    Those are commands, you're supposed to type them into your ssh window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •