Why do I get “Directory not empty” when I try to remove an empty directory? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to delete a non-empty directory in Terminal?How to remove a directory in www folderDoes anyone know of any alternatives to recuva for file recovery?Why am I not being able to tar /opt and move it to my USB location in Linuxhow do I compare values in bash?Unable to Remove DirectoryCan't delete empty directories with strange names/home/username/desktop not recognized: “No such file or directory”Why do I see empty but undeletable files in Google Drive?Making sudo not ask for password

Did any compiler fully use 80-bit floating point?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Twin's vs. Twins'

Random body shuffle every night—can we still function?

Is there any significance to the prison numbers of the Beagle Boys starting with 176-?

Does the transliteration of 'Dravidian' exist in Hindu scripture? Does 'Dravida' refer to a Geographical area or an ethnic group?

Order between one to one functions and their inverses

Did John Wesley plagiarize Matthew Henry...?

Sally's older brother

3D Masyu - A Die

An isoperimetric-type inequality inside a cube

Number of generators of subgroup

New Order #6: Easter Egg

Is the time—manner—place ordering of adverbials an oversimplification?

Why not use the yoke to control yaw, as well as pitch and roll?

How to make an animal which can only breed for a certain number of generations?

Can the Haste spell grant both a Beast Master ranger and their animal companion extra attacks?

Does the main washing effect of soap come from foam?

How does the body cool itself in a stillsuit?

Problem with display of presentation

Table formatting with tabularx?

Should man-made satellites feature an intelligent inverted "cow catcher"?

When to apply negative sign when number is squared

malloc in main() or malloc in another function: allocating memory for a struct and its members



Why do I get “Directory not empty” when I try to remove an empty directory?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to delete a non-empty directory in Terminal?How to remove a directory in www folderDoes anyone know of any alternatives to recuva for file recovery?Why am I not being able to tar /opt and move it to my USB location in Linuxhow do I compare values in bash?Unable to Remove DirectoryCan't delete empty directories with strange names/home/username/desktop not recognized: “No such file or directory”Why do I see empty but undeletable files in Google Drive?Making sudo not ask for password



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








35















I have this empty directory, but I keep getting the following error message:



Cannot remove test: Directory not empty


I know this question has been asked plenty of times but none of them helped.



I tried ls -la to make sure there were no hidden files, and there does not seem to be:
enter image description here



I tried sudo rmdir test as well as sudo rm -rf test, and I just do not know what is wrong.



I read it might be a problem with the file system, but I have no idea how I would go about fixing that.










share|improve this question
























  • Try sudo fsck /

    – ike
    Dec 29 '14 at 4:38






  • 2





    Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

    – vembutech
    Dec 29 '14 at 5:12











  • @rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

    – αғsнιη
    Dec 29 '14 at 11:52







  • 1





    I am confused, why does the user not have execute permissions on the directory, but group does?

    – Julian Stirling
    Aug 3 '15 at 4:45






  • 2





    possible duplicate of How to delete a non-empty directory in Terminal?

    – Radu Rădeanu
    Aug 27 '15 at 14:57

















35















I have this empty directory, but I keep getting the following error message:



Cannot remove test: Directory not empty


I know this question has been asked plenty of times but none of them helped.



I tried ls -la to make sure there were no hidden files, and there does not seem to be:
enter image description here



I tried sudo rmdir test as well as sudo rm -rf test, and I just do not know what is wrong.



I read it might be a problem with the file system, but I have no idea how I would go about fixing that.










share|improve this question
























  • Try sudo fsck /

    – ike
    Dec 29 '14 at 4:38






  • 2





    Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

    – vembutech
    Dec 29 '14 at 5:12











  • @rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

    – αғsнιη
    Dec 29 '14 at 11:52







  • 1





    I am confused, why does the user not have execute permissions on the directory, but group does?

    – Julian Stirling
    Aug 3 '15 at 4:45






  • 2





    possible duplicate of How to delete a non-empty directory in Terminal?

    – Radu Rădeanu
    Aug 27 '15 at 14:57













35












35








35


3






I have this empty directory, but I keep getting the following error message:



Cannot remove test: Directory not empty


I know this question has been asked plenty of times but none of them helped.



I tried ls -la to make sure there were no hidden files, and there does not seem to be:
enter image description here



I tried sudo rmdir test as well as sudo rm -rf test, and I just do not know what is wrong.



I read it might be a problem with the file system, but I have no idea how I would go about fixing that.










share|improve this question
















I have this empty directory, but I keep getting the following error message:



Cannot remove test: Directory not empty


I know this question has been asked plenty of times but none of them helped.



I tried ls -la to make sure there were no hidden files, and there does not seem to be:
enter image description here



I tried sudo rmdir test as well as sudo rm -rf test, and I just do not know what is wrong.



I read it might be a problem with the file system, but I have no idea how I would go about fixing that.







command-line files delete






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 16 '15 at 7:53









αғsнιη

25.1k23100162




25.1k23100162










asked Dec 29 '14 at 4:34









rbrickrbrick

178125




178125












  • Try sudo fsck /

    – ike
    Dec 29 '14 at 4:38






  • 2





    Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

    – vembutech
    Dec 29 '14 at 5:12











  • @rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

    – αғsнιη
    Dec 29 '14 at 11:52







  • 1





    I am confused, why does the user not have execute permissions on the directory, but group does?

    – Julian Stirling
    Aug 3 '15 at 4:45






  • 2





    possible duplicate of How to delete a non-empty directory in Terminal?

    – Radu Rădeanu
    Aug 27 '15 at 14:57

















  • Try sudo fsck /

    – ike
    Dec 29 '14 at 4:38






  • 2





    Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

    – vembutech
    Dec 29 '14 at 5:12











  • @rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

    – αғsнιη
    Dec 29 '14 at 11:52







  • 1





    I am confused, why does the user not have execute permissions on the directory, but group does?

    – Julian Stirling
    Aug 3 '15 at 4:45






  • 2





    possible duplicate of How to delete a non-empty directory in Terminal?

    – Radu Rădeanu
    Aug 27 '15 at 14:57
















Try sudo fsck /

– ike
Dec 29 '14 at 4:38





Try sudo fsck /

– ike
Dec 29 '14 at 4:38




2




2





Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

– vembutech
Dec 29 '14 at 5:12





Is it a normal directory or a mount point. If this is a mount point, it should be unmounted before deleting. If it is a normal directory, sometime there might be some open handles cause this problem. Reboot your machine once and try to delete it.

– vembutech
Dec 29 '14 at 5:12













@rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

– αғsнιη
Dec 29 '14 at 11:52






@rbrick Does test is your login user's name? what is the output of echo $USER? and what echo $HOME?

– αғsнιη
Dec 29 '14 at 11:52





1




1





I am confused, why does the user not have execute permissions on the directory, but group does?

– Julian Stirling
Aug 3 '15 at 4:45





I am confused, why does the user not have execute permissions on the directory, but group does?

– Julian Stirling
Aug 3 '15 at 4:45




2




2





possible duplicate of How to delete a non-empty directory in Terminal?

– Radu Rădeanu
Aug 27 '15 at 14:57





possible duplicate of How to delete a non-empty directory in Terminal?

– Radu Rădeanu
Aug 27 '15 at 14:57










11 Answers
11






active

oldest

votes


















34














I had the same problem on a external hard disk, I tried so many ways using command line, but I failed every time.
That's what worked for me:



  1. Right click on folder

  2. Move to trash

  3. Empty trash

Yes, it's silly but it worked for me (I don't really know how and why, but the damned folder no longer exist)






share|improve this answer

























  • I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

    – artm
    Jun 12 '17 at 7:50






  • 2





    What just happened here? Why did it work?

    – Sahil Arora
    Feb 8 '18 at 20:42











  • What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

    – Marco Ottina
    May 28 '18 at 10:58












  • Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

    – Marco Ottina
    May 28 '18 at 11:06







  • 1





    In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

    – MindJuice
    Jun 7 '18 at 13:38


















4














You could delete it by typing sudo rm -rf dir_name. The directory might have been set to read-only permission. I hope the given command can delete the folder.






share|improve this answer























  • I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

    – naXa
    Mar 14 at 22:24











  • That command in the answer works even if directory has contents and also with subdirectories.

    – Wolverine
    Mar 15 at 15:37











  • don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

    – naXa
    Mar 15 at 15:48











  • this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

    – naXa
    Mar 15 at 15:50


















4














I had the same issue not able to remove directory as it is not empty.



This sequence of operations worked for me.




  1. From command line first



    sudo rmdir --ignore-fail-on-non-empty folder-name-to-be-deleted


The above command helps ubuntu ignore directory is not empty.



  1. Then just go to the folder and Shift + Del. That is all.





share|improve this answer
































    4














    I have win 10 + ubuntu dual system installed. And both systems share the windows parititions.



    Recently, i also ran into unable to delete empty folders in those partitions under ubuntu. I can't find out solution to solve it under linux.



    However, after i switch to windows, and run



    chkdsk


    via cmd for the target disk. Some errors checked out.
    and then i run



    chkdsk /F


    to fix disk error.



    After it finish, i am able to delete those folders now.






    share|improve this answer


















    • 1





      This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

      – krismath
      Jul 19 '18 at 9:25


















    2














    If you are using btrfs, it is possibly an empty directory with a non-zero i_size. You can check whether this is the case with:



    stat -c %s test


    The i_size of an empty folder in btrfs should be zero. In my case, I got 6160 with ~/.config/chromium/Default.



    The suggested solution is to unmount the filesystem, run btrfs check to confirm the issue and check for other problematic directories, and finally run btrfs check --repair to fix. This operation is risky, though, so it's a good idea to backup files first.



    Source: Btrfs Problem FAQ






    share|improve this answer
































      2














      GUI solution



      1. Move or cut & paste the folder to trash folder

      2. empty the trash

      it is done.



      Command-line solution



      sudo mv folder_error/ .local/share/Trash


      you can clear with trash-cli: trash-empty
      or



      sudo rm -fr ~/.local/share/Trash/*





      share|improve this answer

























      • I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

        – Jake Fisher
        Jul 20 '18 at 21:57


















      1














      If the directory is part of a filesystem mounted with CIFS (aka samba), and it contains a file that is a broken symbolic link, then ls fails to mention that file. (I observe this bug on a CIFS client running 14.04.2 LTS, and a server running 12.04.5 LTS.)



      So the directory is not empty, but (over CIFS) you have no way to see that. The file can only be seen, and thus can only be deleted, by a command running on the fileserver hosting that filesystem.






      share|improve this answer






























        1














        I had the same issue on Ubuntu 16.04 and I fixed it by:



        1. emptying the trash folder

        2. rebooting

        Opening and closing the file manager did no good—only rebooting worked.






        share|improve this answer
































          0














          try this command:



          sudo lsof | grep deleted 


          Check in the list if your directory is still in use. :D



          If so, stop the service and you will be able delete the directory.






          share|improve this answer

























          • Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

            – David Foerster
            Jul 18 '17 at 13:18


















          0














          This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.






          share|improve this answer
































            0














            On my mac machine, I just used the command rm -Rf (capital R.) And viola!






            share|improve this answer








            New contributor




            Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "89"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f566474%2fwhy-do-i-get-directory-not-empty-when-i-try-to-remove-an-empty-directory%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              11 Answers
              11






              active

              oldest

              votes








              11 Answers
              11






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              34














              I had the same problem on a external hard disk, I tried so many ways using command line, but I failed every time.
              That's what worked for me:



              1. Right click on folder

              2. Move to trash

              3. Empty trash

              Yes, it's silly but it worked for me (I don't really know how and why, but the damned folder no longer exist)






              share|improve this answer

























              • I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

                – artm
                Jun 12 '17 at 7:50






              • 2





                What just happened here? Why did it work?

                – Sahil Arora
                Feb 8 '18 at 20:42











              • What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

                – Marco Ottina
                May 28 '18 at 10:58












              • Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

                – Marco Ottina
                May 28 '18 at 11:06







              • 1





                In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

                – MindJuice
                Jun 7 '18 at 13:38















              34














              I had the same problem on a external hard disk, I tried so many ways using command line, but I failed every time.
              That's what worked for me:



              1. Right click on folder

              2. Move to trash

              3. Empty trash

              Yes, it's silly but it worked for me (I don't really know how and why, but the damned folder no longer exist)






              share|improve this answer

























              • I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

                – artm
                Jun 12 '17 at 7:50






              • 2





                What just happened here? Why did it work?

                – Sahil Arora
                Feb 8 '18 at 20:42











              • What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

                – Marco Ottina
                May 28 '18 at 10:58












              • Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

                – Marco Ottina
                May 28 '18 at 11:06







              • 1





                In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

                – MindJuice
                Jun 7 '18 at 13:38













              34












              34








              34







              I had the same problem on a external hard disk, I tried so many ways using command line, but I failed every time.
              That's what worked for me:



              1. Right click on folder

              2. Move to trash

              3. Empty trash

              Yes, it's silly but it worked for me (I don't really know how and why, but the damned folder no longer exist)






              share|improve this answer















              I had the same problem on a external hard disk, I tried so many ways using command line, but I failed every time.
              That's what worked for me:



              1. Right click on folder

              2. Move to trash

              3. Empty trash

              Yes, it's silly but it worked for me (I don't really know how and why, but the damned folder no longer exist)







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 18 '17 at 13:17









              David Foerster

              28.7k1367113




              28.7k1367113










              answered Feb 19 '16 at 10:13









              Marco OttinaMarco Ottina

              45643




              45643












              • I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

                – artm
                Jun 12 '17 at 7:50






              • 2





                What just happened here? Why did it work?

                – Sahil Arora
                Feb 8 '18 at 20:42











              • What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

                – Marco Ottina
                May 28 '18 at 10:58












              • Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

                – Marco Ottina
                May 28 '18 at 11:06







              • 1





                In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

                – MindJuice
                Jun 7 '18 at 13:38

















              • I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

                – artm
                Jun 12 '17 at 7:50






              • 2





                What just happened here? Why did it work?

                – Sahil Arora
                Feb 8 '18 at 20:42











              • What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

                – Marco Ottina
                May 28 '18 at 10:58












              • Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

                – Marco Ottina
                May 28 '18 at 11:06







              • 1





                In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

                – MindJuice
                Jun 7 '18 at 13:38
















              I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

              – artm
              Jun 12 '17 at 7:50





              I got the same issue and your answer works. Not quite sure what the silly thing happened, and why "-rf" failed to remove an non-empty folder.

              – artm
              Jun 12 '17 at 7:50




              2




              2





              What just happened here? Why did it work?

              – Sahil Arora
              Feb 8 '18 at 20:42





              What just happened here? Why did it work?

              – Sahil Arora
              Feb 8 '18 at 20:42













              What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

              – Marco Ottina
              May 28 '18 at 10:58






              What happened? Honestly, i don't know. Maybe, the folder's file was corrupted for some reason: a flag like "is-empty" or the file counter like "how-many-file-inside" has been setted to an erroneous value. Sometimes, errors like this could be caused by damages on the hard disk. Why did it work? I don't know how commands are implemented (think about C), but I guess they check those flags and counters before acting (i mean, if file counter >0 then "error: directory not empty" and abort), while emptying the trash directly remove the folder and all its file and subfolder without any kind of check.

              – Marco Ottina
              May 28 '18 at 10:58














              Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

              – Marco Ottina
              May 28 '18 at 11:06






              Maybe, deleting a folder through command line requires some conditions, like the emptiness of the folder, (because removing the folder's node from file system removes only that single linknode and requires the folder to be empty so no other file-node would be "forgot" through the file system due to losing the intermediate link to them, represented by the folder) .. and deleting a folder through right click -> delete or emptying the trash removes the folder AND all file and subfolders recursively, not caring of flags, counters and stuffs like that (so, no checks are performed)

              – Marco Ottina
              May 28 '18 at 11:06





              1




              1





              In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

              – MindJuice
              Jun 7 '18 at 13:38





              In my case, the subdirectory in question happened to be in a folder that was shared from my Mac to a linux VM, and I was trying to delete the folder from the linux VM side. It seems that the Mac side was holding onto some folders. Doing the rm -rf from the Mac side worked.

              – MindJuice
              Jun 7 '18 at 13:38













              4














              You could delete it by typing sudo rm -rf dir_name. The directory might have been set to read-only permission. I hope the given command can delete the folder.






              share|improve this answer























              • I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

                – naXa
                Mar 14 at 22:24











              • That command in the answer works even if directory has contents and also with subdirectories.

                – Wolverine
                Mar 15 at 15:37











              • don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

                – naXa
                Mar 15 at 15:48











              • this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

                – naXa
                Mar 15 at 15:50















              4














              You could delete it by typing sudo rm -rf dir_name. The directory might have been set to read-only permission. I hope the given command can delete the folder.






              share|improve this answer























              • I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

                – naXa
                Mar 14 at 22:24











              • That command in the answer works even if directory has contents and also with subdirectories.

                – Wolverine
                Mar 15 at 15:37











              • don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

                – naXa
                Mar 15 at 15:48











              • this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

                – naXa
                Mar 15 at 15:50













              4












              4








              4







              You could delete it by typing sudo rm -rf dir_name. The directory might have been set to read-only permission. I hope the given command can delete the folder.






              share|improve this answer













              You could delete it by typing sudo rm -rf dir_name. The directory might have been set to read-only permission. I hope the given command can delete the folder.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Dec 29 '14 at 23:32









              WolverineWolverine

              629413




              629413












              • I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

                – naXa
                Mar 14 at 22:24











              • That command in the answer works even if directory has contents and also with subdirectories.

                – Wolverine
                Mar 15 at 15:37











              • don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

                – naXa
                Mar 15 at 15:48











              • this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

                – naXa
                Mar 15 at 15:50

















              • I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

                – naXa
                Mar 14 at 22:24











              • That command in the answer works even if directory has contents and also with subdirectories.

                – Wolverine
                Mar 15 at 15:37











              • don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

                – naXa
                Mar 15 at 15:48











              • this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

                – naXa
                Mar 15 at 15:50
















              I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

              – naXa
              Mar 14 at 22:24





              I get Directory not empty anyway. It seems strange, so I recorded my screen to prove.

              – naXa
              Mar 14 at 22:24













              That command in the answer works even if directory has contents and also with subdirectories.

              – Wolverine
              Mar 15 at 15:37





              That command in the answer works even if directory has contents and also with subdirectories.

              – Wolverine
              Mar 15 at 15:37













              don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

              – naXa
              Mar 15 at 15:48





              don't believe me just watch :D drive.google.com/open?id=1UEYVa4UT6df7xucrq-lO82xjk3afHHzA

              – naXa
              Mar 15 at 15:48













              this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

              – naXa
              Mar 15 at 15:50





              this strange behaviour was caused by errors in NTFS partition. solved with chkdsk /F.

              – naXa
              Mar 15 at 15:50











              4














              I had the same issue not able to remove directory as it is not empty.



              This sequence of operations worked for me.




              1. From command line first



                sudo rmdir --ignore-fail-on-non-empty folder-name-to-be-deleted


              The above command helps ubuntu ignore directory is not empty.



              1. Then just go to the folder and Shift + Del. That is all.





              share|improve this answer





























                4














                I had the same issue not able to remove directory as it is not empty.



                This sequence of operations worked for me.




                1. From command line first



                  sudo rmdir --ignore-fail-on-non-empty folder-name-to-be-deleted


                The above command helps ubuntu ignore directory is not empty.



                1. Then just go to the folder and Shift + Del. That is all.





                share|improve this answer



























                  4












                  4








                  4







                  I had the same issue not able to remove directory as it is not empty.



                  This sequence of operations worked for me.




                  1. From command line first



                    sudo rmdir --ignore-fail-on-non-empty folder-name-to-be-deleted


                  The above command helps ubuntu ignore directory is not empty.



                  1. Then just go to the folder and Shift + Del. That is all.





                  share|improve this answer















                  I had the same issue not able to remove directory as it is not empty.



                  This sequence of operations worked for me.




                  1. From command line first



                    sudo rmdir --ignore-fail-on-non-empty folder-name-to-be-deleted


                  The above command helps ubuntu ignore directory is not empty.



                  1. Then just go to the folder and Shift + Del. That is all.






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 15 '17 at 7:12









                  Anwar

                  57.6k22149257




                  57.6k22149257










                  answered Apr 15 '17 at 3:58









                  AmitAmit

                  412




                  412





















                      4














                      I have win 10 + ubuntu dual system installed. And both systems share the windows parititions.



                      Recently, i also ran into unable to delete empty folders in those partitions under ubuntu. I can't find out solution to solve it under linux.



                      However, after i switch to windows, and run



                      chkdsk


                      via cmd for the target disk. Some errors checked out.
                      and then i run



                      chkdsk /F


                      to fix disk error.



                      After it finish, i am able to delete those folders now.






                      share|improve this answer


















                      • 1





                        This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                        – krismath
                        Jul 19 '18 at 9:25















                      4














                      I have win 10 + ubuntu dual system installed. And both systems share the windows parititions.



                      Recently, i also ran into unable to delete empty folders in those partitions under ubuntu. I can't find out solution to solve it under linux.



                      However, after i switch to windows, and run



                      chkdsk


                      via cmd for the target disk. Some errors checked out.
                      and then i run



                      chkdsk /F


                      to fix disk error.



                      After it finish, i am able to delete those folders now.






                      share|improve this answer


















                      • 1





                        This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                        – krismath
                        Jul 19 '18 at 9:25













                      4












                      4








                      4







                      I have win 10 + ubuntu dual system installed. And both systems share the windows parititions.



                      Recently, i also ran into unable to delete empty folders in those partitions under ubuntu. I can't find out solution to solve it under linux.



                      However, after i switch to windows, and run



                      chkdsk


                      via cmd for the target disk. Some errors checked out.
                      and then i run



                      chkdsk /F


                      to fix disk error.



                      After it finish, i am able to delete those folders now.






                      share|improve this answer













                      I have win 10 + ubuntu dual system installed. And both systems share the windows parititions.



                      Recently, i also ran into unable to delete empty folders in those partitions under ubuntu. I can't find out solution to solve it under linux.



                      However, after i switch to windows, and run



                      chkdsk


                      via cmd for the target disk. Some errors checked out.
                      and then i run



                      chkdsk /F


                      to fix disk error.



                      After it finish, i am able to delete those folders now.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jul 12 '17 at 2:31









                      e-cloude-cloud

                      1507




                      1507







                      • 1





                        This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                        – krismath
                        Jul 19 '18 at 9:25












                      • 1





                        This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                        – krismath
                        Jul 19 '18 at 9:25







                      1




                      1





                      This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                      – krismath
                      Jul 19 '18 at 9:25





                      This method works for me. I think it is also important to note that the shared partition(s) is NTFS formatted and that it is probably corrupted.

                      – krismath
                      Jul 19 '18 at 9:25











                      2














                      If you are using btrfs, it is possibly an empty directory with a non-zero i_size. You can check whether this is the case with:



                      stat -c %s test


                      The i_size of an empty folder in btrfs should be zero. In my case, I got 6160 with ~/.config/chromium/Default.



                      The suggested solution is to unmount the filesystem, run btrfs check to confirm the issue and check for other problematic directories, and finally run btrfs check --repair to fix. This operation is risky, though, so it's a good idea to backup files first.



                      Source: Btrfs Problem FAQ






                      share|improve this answer





























                        2














                        If you are using btrfs, it is possibly an empty directory with a non-zero i_size. You can check whether this is the case with:



                        stat -c %s test


                        The i_size of an empty folder in btrfs should be zero. In my case, I got 6160 with ~/.config/chromium/Default.



                        The suggested solution is to unmount the filesystem, run btrfs check to confirm the issue and check for other problematic directories, and finally run btrfs check --repair to fix. This operation is risky, though, so it's a good idea to backup files first.



                        Source: Btrfs Problem FAQ






                        share|improve this answer



























                          2












                          2








                          2







                          If you are using btrfs, it is possibly an empty directory with a non-zero i_size. You can check whether this is the case with:



                          stat -c %s test


                          The i_size of an empty folder in btrfs should be zero. In my case, I got 6160 with ~/.config/chromium/Default.



                          The suggested solution is to unmount the filesystem, run btrfs check to confirm the issue and check for other problematic directories, and finally run btrfs check --repair to fix. This operation is risky, though, so it's a good idea to backup files first.



                          Source: Btrfs Problem FAQ






                          share|improve this answer















                          If you are using btrfs, it is possibly an empty directory with a non-zero i_size. You can check whether this is the case with:



                          stat -c %s test


                          The i_size of an empty folder in btrfs should be zero. In my case, I got 6160 with ~/.config/chromium/Default.



                          The suggested solution is to unmount the filesystem, run btrfs check to confirm the issue and check for other problematic directories, and finally run btrfs check --repair to fix. This operation is risky, though, so it's a good idea to backup files first.



                          Source: Btrfs Problem FAQ







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Apr 15 '17 at 6:00









                          Zanna

                          51.5k13141244




                          51.5k13141244










                          answered Feb 14 '16 at 9:29









                          wzhdwzhd

                          965




                          965





















                              2














                              GUI solution



                              1. Move or cut & paste the folder to trash folder

                              2. empty the trash

                              it is done.



                              Command-line solution



                              sudo mv folder_error/ .local/share/Trash


                              you can clear with trash-cli: trash-empty
                              or



                              sudo rm -fr ~/.local/share/Trash/*





                              share|improve this answer

























                              • I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                                – Jake Fisher
                                Jul 20 '18 at 21:57















                              2














                              GUI solution



                              1. Move or cut & paste the folder to trash folder

                              2. empty the trash

                              it is done.



                              Command-line solution



                              sudo mv folder_error/ .local/share/Trash


                              you can clear with trash-cli: trash-empty
                              or



                              sudo rm -fr ~/.local/share/Trash/*





                              share|improve this answer

























                              • I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                                – Jake Fisher
                                Jul 20 '18 at 21:57













                              2












                              2








                              2







                              GUI solution



                              1. Move or cut & paste the folder to trash folder

                              2. empty the trash

                              it is done.



                              Command-line solution



                              sudo mv folder_error/ .local/share/Trash


                              you can clear with trash-cli: trash-empty
                              or



                              sudo rm -fr ~/.local/share/Trash/*





                              share|improve this answer















                              GUI solution



                              1. Move or cut & paste the folder to trash folder

                              2. empty the trash

                              it is done.



                              Command-line solution



                              sudo mv folder_error/ .local/share/Trash


                              you can clear with trash-cli: trash-empty
                              or



                              sudo rm -fr ~/.local/share/Trash/*






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Jul 18 '17 at 13:23









                              David Foerster

                              28.7k1367113




                              28.7k1367113










                              answered Jul 18 '17 at 13:09









                              Kadir Y.Kadir Y.

                              315




                              315












                              • I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                                – Jake Fisher
                                Jul 20 '18 at 21:57

















                              • I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                                – Jake Fisher
                                Jul 20 '18 at 21:57
















                              I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                              – Jake Fisher
                              Jul 20 '18 at 21:57





                              I think the command line solution here is actually a general solution. Move the empty folder to another location, and remove it once it's moved. E.g., something like this mkdir a ; mv test a/ ; rm -rf a/test ; rm -rf a. An approach like that worked for me (although I have no idea why it would), and I didn't need root access.

                              – Jake Fisher
                              Jul 20 '18 at 21:57











                              1














                              If the directory is part of a filesystem mounted with CIFS (aka samba), and it contains a file that is a broken symbolic link, then ls fails to mention that file. (I observe this bug on a CIFS client running 14.04.2 LTS, and a server running 12.04.5 LTS.)



                              So the directory is not empty, but (over CIFS) you have no way to see that. The file can only be seen, and thus can only be deleted, by a command running on the fileserver hosting that filesystem.






                              share|improve this answer



























                                1














                                If the directory is part of a filesystem mounted with CIFS (aka samba), and it contains a file that is a broken symbolic link, then ls fails to mention that file. (I observe this bug on a CIFS client running 14.04.2 LTS, and a server running 12.04.5 LTS.)



                                So the directory is not empty, but (over CIFS) you have no way to see that. The file can only be seen, and thus can only be deleted, by a command running on the fileserver hosting that filesystem.






                                share|improve this answer

























                                  1












                                  1








                                  1







                                  If the directory is part of a filesystem mounted with CIFS (aka samba), and it contains a file that is a broken symbolic link, then ls fails to mention that file. (I observe this bug on a CIFS client running 14.04.2 LTS, and a server running 12.04.5 LTS.)



                                  So the directory is not empty, but (over CIFS) you have no way to see that. The file can only be seen, and thus can only be deleted, by a command running on the fileserver hosting that filesystem.






                                  share|improve this answer













                                  If the directory is part of a filesystem mounted with CIFS (aka samba), and it contains a file that is a broken symbolic link, then ls fails to mention that file. (I observe this bug on a CIFS client running 14.04.2 LTS, and a server running 12.04.5 LTS.)



                                  So the directory is not empty, but (over CIFS) you have no way to see that. The file can only be seen, and thus can only be deleted, by a command running on the fileserver hosting that filesystem.







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Jun 19 '15 at 20:10









                                  Camille GoudeseuneCamille Goudeseune

                                  1669




                                  1669





















                                      1














                                      I had the same issue on Ubuntu 16.04 and I fixed it by:



                                      1. emptying the trash folder

                                      2. rebooting

                                      Opening and closing the file manager did no good—only rebooting worked.






                                      share|improve this answer





























                                        1














                                        I had the same issue on Ubuntu 16.04 and I fixed it by:



                                        1. emptying the trash folder

                                        2. rebooting

                                        Opening and closing the file manager did no good—only rebooting worked.






                                        share|improve this answer



























                                          1












                                          1








                                          1







                                          I had the same issue on Ubuntu 16.04 and I fixed it by:



                                          1. emptying the trash folder

                                          2. rebooting

                                          Opening and closing the file manager did no good—only rebooting worked.






                                          share|improve this answer















                                          I had the same issue on Ubuntu 16.04 and I fixed it by:



                                          1. emptying the trash folder

                                          2. rebooting

                                          Opening and closing the file manager did no good—only rebooting worked.







                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Aug 3 '16 at 1:30

























                                          answered Aug 2 '16 at 21:20









                                          daledale

                                          112




                                          112





















                                              0














                                              try this command:



                                              sudo lsof | grep deleted 


                                              Check in the list if your directory is still in use. :D



                                              If so, stop the service and you will be able delete the directory.






                                              share|improve this answer

























                                              • Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                                – David Foerster
                                                Jul 18 '17 at 13:18















                                              0














                                              try this command:



                                              sudo lsof | grep deleted 


                                              Check in the list if your directory is still in use. :D



                                              If so, stop the service and you will be able delete the directory.






                                              share|improve this answer

























                                              • Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                                – David Foerster
                                                Jul 18 '17 at 13:18













                                              0












                                              0








                                              0







                                              try this command:



                                              sudo lsof | grep deleted 


                                              Check in the list if your directory is still in use. :D



                                              If so, stop the service and you will be able delete the directory.






                                              share|improve this answer















                                              try this command:



                                              sudo lsof | grep deleted 


                                              Check in the list if your directory is still in use. :D



                                              If so, stop the service and you will be able delete the directory.







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Jan 1 '15 at 21:27









                                              Eric Carvalho

                                              42.6k17118148




                                              42.6k17118148










                                              answered Dec 29 '14 at 10:49









                                              ashwin2011ashwin2011

                                              294




                                              294












                                              • Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                                – David Foerster
                                                Jul 18 '17 at 13:18

















                                              • Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                                – David Foerster
                                                Jul 18 '17 at 13:18
















                                              Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                              – David Foerster
                                              Jul 18 '17 at 13:18





                                              Obviously the directory won't show up in the list of open, deleted file descriptors if it can't be deleted. ;-]

                                              – David Foerster
                                              Jul 18 '17 at 13:18











                                              0














                                              This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.






                                              share|improve this answer





























                                                0














                                                This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.






                                                share|improve this answer



























                                                  0












                                                  0








                                                  0







                                                  This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.






                                                  share|improve this answer















                                                  This problem appears when those folders or files are not copied completely. It's Input/Output Error. I tried to delete with Shift+Del or through commands, but these did not work. I tried right click and "Move to Trash" and it worked.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Apr 9 '16 at 7:38









                                                  techraf

                                                  2,78592035




                                                  2,78592035










                                                  answered Apr 9 '16 at 4:28









                                                  lhodenizlhodeniz

                                                  53




                                                  53





















                                                      0














                                                      On my mac machine, I just used the command rm -Rf (capital R.) And viola!






                                                      share|improve this answer








                                                      New contributor




                                                      Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.
























                                                        0














                                                        On my mac machine, I just used the command rm -Rf (capital R.) And viola!






                                                        share|improve this answer








                                                        New contributor




                                                        Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.






















                                                          0












                                                          0








                                                          0







                                                          On my mac machine, I just used the command rm -Rf (capital R.) And viola!






                                                          share|improve this answer








                                                          New contributor




                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.










                                                          On my mac machine, I just used the command rm -Rf (capital R.) And viola!







                                                          share|improve this answer








                                                          New contributor




                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.









                                                          share|improve this answer



                                                          share|improve this answer






                                                          New contributor




                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.









                                                          answered 28 mins ago









                                                          Dude803Dude803

                                                          1




                                                          1




                                                          New contributor




                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.





                                                          New contributor





                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.






                                                          Dude803 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                          Check out our Code of Conduct.



























                                                              draft saved

                                                              draft discarded
















































                                                              Thanks for contributing an answer to Ask Ubuntu!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid


                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.

                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function ()
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f566474%2fwhy-do-i-get-directory-not-empty-when-i-try-to-remove-an-empty-directory%23new-answer', 'question_page');

                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

                                                              Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

                                                              Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»