Results 1 to 3 of 3

Thread: commands

  1. #1
    Join Date
    Jun 2007
    Location
    London
    Beans
    112
    Distro
    Ubuntu 8.04 Hardy Heron

    commands

    Hey all,

    Can anyone tell me the correct command to delete a file thats over x amount of days old automatically?

    Thanks in advance

  2. #2
    Join Date
    Jun 2008
    Beans
    202

    Re: commands

    easy, you can use "find" to do this

    find ./ -ctime +3 | xargs rm

    find anything older than 3 days under current dir and delete it

  3. #3
    Join Date
    Jun 2007
    Location
    London
    Beans
    112
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: commands

    exactly what i needed thanks

Bookmarks

Posting Permissions

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