Mac os x rm directory not empty

This should tell if any files in this directory are being used by any programmes. Anyway, killall 1 any executables that might be using this directory or any hidden files inside it. Hope this helps. Check for any hidden and encrypted files or encryption key files in that directory. These could be the culprit. I ran into exactly this error while also trying to remove a directory rm -r dirname.

How To Force Empty The Trash Mac - Delete Stuck Files

I had already tried all of the suggestions I've read here before I searched and found this thread. I do not know if there may have been any additional points unintentionally left unstated from the original question, but in my case the root of the trouble, and the solution was:. I logged into the network disk server via the ssh command and checked ls -al there. The result showed, in addition to.

In Mac OS X, why can't I empty the Trash or throw away a particular file or folder?

I believe these are, or are similar to, files which I first noted Mac OSX creating years ago when using cp -R , tar , or cpio to archive or move groups of files. I had never encountered trouble deleting these files when they had been written onto an internal, USB, or Firewire drive; this was the first time I'd found them on a network disk; completely undetectable from the client side of the mount, but normal in every way when viewed from the server side.

So, there's another answer for what it's worth; another potential solution to this problem if it should appear for anyone in conjunction with a network disk. This could also be a case I just solved in which a broken symlink was on the server-side and was not visible to the client over CIFS. The symlink populated a non-empty directory, but the client was unable to see or stat the symlink for the purpose of clearing out the directory before unlinking the directory. Since it was invisible, it created this paradox where from the client side it was empty but "not empty" upon challenge by rm.

If you have SSH access to the server, try a shell on that end and see if the directory is truly empty or if it may have broken symlinks.


  1. how to play downloaded xbox 360 games on mac.
  2. neat image for mac os x download.
  3. minecraft mac download free offline;
  4. All replies.
  5. Master the command line: Deleting files and folders;
  6. Why bother deleting files with the command line?.

I was able to do this on a Drobo5N and it saved my butt. Tried all of the answers here with no results. I was, however, able to move the directory aside using the mv command, which allowed me to continue. Beware rm -rf in such a case!


  • extract frames from video mac os x!
  • at&t outgoing mail server settings mac?
  • shell - Why am i getting "Directory not empty" error in terminal when using rmdir? - Stack Overflow?
  • It can create problems somewhere else in case it happen to be a network share! You have been warned! In nearly all cases, if a directory seems to be empty, use rmdir directory or perhaps sudo rmdir directory.

    Apple Footer

    Do not use rm or del under Windows. If this does not work, you need to find out, what blocks this request, fix that and then retry the rmdir. It is very likely that the directory in question was just a mount point from the encfs or residing on a mount point which became readonly or stuck in some improper state which prevented the directory to be removed. If you now force removal of the directory, very bad things can happen. In the good case the directory really was empty, so removing it destroying the mount etc.

    ARCHIVED: In Mac OS X, why can't I empty the Trash or throw away a particular file or folder?

    In the bad case it wasn't empty, just appeared to be, which means, you trashed something which you perhaps did not want to kill. This all depends on the mount type, which drivers are in use etc. If things are implemented reasonably well, normally nothing bad should happen. However this is not the normal case. Things are in a weird state already, which means: Something is wrong, so better do not try to mix it up even further!

    If something is cracked, any wrong touch might break it. For example, if you hit a race condition on a network share, it might be that your rm -rf removes data which is just copied to the share by somebody else. However rmdir is guaranteed to never do harm, besides removing really empty directories. You can detect a mountpoint using the tool mountpoint directory. Alternatively look into the output of mount and try to spot your mounts there.

    Delete files

    When can the rm -R command come in handy? A file might be locked or you may not have permission to delete one or more files. This sort of glitch is annoying, but you can use the command line to provide an easy solution. In the Finder, open the Trash, and then drag the items it contains to the Terminal window.

    If there are lots of files, you may find that the resulting list—all on one long line, wrapping in the Terminal window—may be very long. Terminal will empty the Trash.

    Your Answer

    Command line win! Want to learn more? See our articles about navigating the file system with the command line , learning from man pages , and copying and moving files. He's also the author of Take Control of iTunes The FAQ. Command-line lifesavers. How to make a bootable Mavericks install drive. Mac essentials: Why bother deleting files with the command line? Here are some reasons: You can delete multiple files quickly and efficiently using wildcards.

    Directory Not Empty and cannot empty Trash

    You can remove files from the Trash when you encounter stubborn errors. You can delete files that are hidden in the Finder; these files, which can contain settings for certain apps or parts of OS X, contain a dot. I'm unable to remove a directory like "New Folder" using all the above detailed commands.

    It's double worded. But I want to remove that directory. Any suggestions will be welcomed. Just doing rm -r lampp will do. Use the below command: In case user doesn't have the permission to delete the folder: Add sudo at the beginning of the command: And it's a good practice to try not to use -f while deleting a directory: Trae 2 3 Shantanu Banerjee Shantanu Banerjee 8, 1 8 5. In my humble opinion, it's a good practice never to add the "f" on first attempt. BKSpurgeon not unless you accidentally type --no-preserve-root too.

    A file "xxx" owner: This is the message without -f: Safer version rm -R -i lampp Adding -i makes it a little safer, because it will prompt you on every deletion. Note about -f option: I only tend to use uppercase -R because it's consistent with other commands I use such as grep and chmod , some of which only support the uppercase form.

    This one worked for me using adb android debug bridge on Android. Was trying rm -rf but it didn't work. Had to use rm -R. I was having some trouble with that today, but I overcame it with sudo.