Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Delete FIles older than a Set date or number of hours


    I am trying to delete fines on a remote server that has become very full
    I am new to linux but this task has been lumpe with me
    Have been told i have to mix find and rm so would it be some thing like this ?
    to remove more than 24 hour old files. With comfirm

    find / Desktop/ -mtime +24 rm -i

    i just have no idea really but an trying to make this work

  2. #2
    I think would be something like
    Code:
    find / Desktop/ -mtime 1 | rm -i
    although I would look around the man pages of find and rm

  3. #3
    No that don t seem to do it

    $ find / Desktop/ -mtime 1 | rm -i
    usage: rm [-f | -i] [-dPRrvW] file ...
    unlink file
    $ find / Desktop/ -mtime 1 | rm [-i]
    rm: [-i]: No such file or directory
    $ rm - i
    rm: -: No such file or directory
    rm: i: No such file or directory
    $ rm -i
    usage: rm [-f | -i] [-dPRrvW] file ...
    unlink file

  4. $spacer_open
    $spacer_close
  5. #4
    rm -i < `find home/ -mtime 24`
    no
    find home/ -delete -mtime +24
    no
    rm -i > `find / home/ -mtime +24`

  6. #5
    now was also thinking
    But that dont work either
    find / -name *.old.* -print > /tmp/delete_files.txt

  7. #6
    Try

    Code:
    find / -name *.old.* -mtime 1 -exec rm &#123;&#125; \;
    You might want to try

    Code:
    find / -name *.old.* -mtime 1 -exec ls -l &#123;&#125; \;
    first

    Cheers

    Spook

Posting Permissions

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