Krechowiak

Q: how to find and kill processes running on my mac

Sometimes, when I try to delete item in the trash I get the message: "The operation can't be complete because the item "xxx.pdf" is in use."

How should I proceed to delete anyway?

MacBook Pro with Retina display, Mac OS X (10.7.5)

Posted on Jun 28, 2016 8:03 AM

Close

Q: how to find and kill processes running on my mac

  • All replies
  • Helpful answers

  • by Phil0124,Helpful

    Phil0124 Phil0124 Jun 28, 2016 8:11 AM in response to Krechowiak
    Level 7 (26,990 points)
    iPhone
    Jun 28, 2016 8:11 AM in response to Krechowiak

    You can use Activity Monitor to see a list of running processes, and attempt to kill one. Be careful with this, as you can potentially kill important processes.

    Use Activity Monitor on your Mac - Apple Support

     

    It won't tell you what process is using the file however.

     

    Preview sometimes will not release a file after being viewed. You can Command + Click on Preview's icon on the dock and attempt to kill it.

  • by WZZZ,Solvedanswer

    WZZZ WZZZ Jun 29, 2016 5:51 AM in response to Krechowiak
    Level 6 (13,087 points)
    Mac OS X
    Jun 29, 2016 5:51 AM in response to Krechowiak

    If it's not immediately clear what process needs to be quit, what I do:

     

    -drag the file or files out of the Trash to the Desktop

     

    -open Terminal in Applications>Utilities

     

    -enter "rm -rf" no quotes

     

    -leave a space after rm -rf, and drag the file in question into the Terminal window.

     

    -Hit return and it should be gone.

     

    ---------------------

     

    For more stubborn cases, enter "sudo rm -rf"  no quotes

     

    -leave a space

     

    -proceed as before and give your admin password (which won't appear in any form when entered) when requested.

     

    ----------------------

     

    Still won't work? Put the file back in the Trash

     

    sudo rm -rf ~/.Trash

     

    There is a single space between sudo and rm

     

                                              "          rm and -rf

     

                                              "        -rf and ~/.Trash

     

    ----------------------------

     

    If you REALLY want to find the process being used:

     

    Open Terminal and paste this in (lsof means "list of open files.") Now you have to hunt down the one involved. Might need some trial and error.)

     

    lsof -l +L -R -V | grep /