Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I am trying to clean out an entire website (multiple installations) that has been configured with macromedia contribute. Said software has created thousands of LCK files (lock files). I ...
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    6

    rm command for entire website

    Hi, I am trying to clean out an entire website (multiple installations) that has been configured with macromedia contribute. Said software has created thousands of LCK files (lock files). I want to use the rm command to remove every *.LCK file in every directory and subdirectory but it does not seem to work, the format I am trying is:

    rm -fR /home/mydomain/public_html/*.LCK

    is this correct or is there a simpler way to do this

    EDIT: I have since found the solution, I apologise, I should have googled harder before posting but I will edit and include the solution as it may be useful to someone.

    find . -type f -name "*.LCK" -exec rm -i {} \; - With confirmation
    find . -type f -name "*.LCK" -exec rm -f {} \; - Without confirmation

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    Try the following
    Code:
    $find /home/mydomain/public_html/ -name "*.LCK" -exec rm '{}' \;

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    6
    thanks Daark, lol, you must have replied as I was editing the post. Many thanks indeed. I seem to be inundated with helpfull friends since venturing into the linux world.

  4. #4
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    That should work ( I think it should be a lowercase 'r' though as the switch). A cleaner way would be to run
    Code:
    find -iname *.LCK -exec rm {} \;
    This will only run against .LCK files so it should give you a little piece of mind. If you are going to do anything like this it is always a good idea to backup first!

    EDIT - Beaten to it!

Posting Permissions

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