Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
  1. #1
    Just Joined!
    Join Date
    Dec 2004
    Posts
    4

    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
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,408
    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
    Just Joined!
    Join Date
    Dec 2004
    Posts
    4
    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. #4
    Just Joined!
    Join Date
    Dec 2004
    Posts
    4
    rm -i < `find home/ -mtime 24`
    no
    find home/ -delete -mtime +24
    no
    rm -i > `find / home/ -mtime +24`

  5. #5
    Just Joined!
    Join Date
    Dec 2004
    Posts
    4
    now was also thinking
    But that dont work either
    find / -name *.old.* -print > /tmp/delete_files.txt

  6. #6
    Just Joined!
    Join Date
    Dec 2004
    Posts
    12
    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
  •  
...