Why does deleting a folder from the command line take longer than manual deletion?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I noticed whenever I want to delete a folder containing a lot of data using a command line (sudo rm -r folder_name), the Terminal hangs on for the operation to terminate. But at the same time, when I manually delete a folder of similar size, the deletion is performed instantly without waiting.



Any explanation as to why this difference happens










share|improve this question



























    up vote
    5
    down vote

    favorite












    I noticed whenever I want to delete a folder containing a lot of data using a command line (sudo rm -r folder_name), the Terminal hangs on for the operation to terminate. But at the same time, when I manually delete a folder of similar size, the deletion is performed instantly without waiting.



    Any explanation as to why this difference happens










    share|improve this question

























      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      I noticed whenever I want to delete a folder containing a lot of data using a command line (sudo rm -r folder_name), the Terminal hangs on for the operation to terminate. But at the same time, when I manually delete a folder of similar size, the deletion is performed instantly without waiting.



      Any explanation as to why this difference happens










      share|improve this question















      I noticed whenever I want to delete a folder containing a lot of data using a command line (sudo rm -r folder_name), the Terminal hangs on for the operation to terminate. But at the same time, when I manually delete a folder of similar size, the deletion is performed instantly without waiting.



      Any explanation as to why this difference happens







      command-line delete






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 27 mins ago









      Boann

      1113




      1113










      asked 5 hours ago









      Billal Begueradj

      4484827




      4484827




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          10
          down vote













          When you delete from the GUI you are only moving the files to the trash bin. This updates the pointers to the files instantaneously saying that they now reside in the trash bin which is another folder.



          When you delete from the command line like that it is removing the files 1 by 1 until they are all gone from within the folder then removing the folder itself. This bypasses the trash bin. This also takes longer.



          If you do a Shift+Del in the GUI this will bypass the trash bin and take longer to delete.



          Hope this helps!






          share|improve this answer






















          • For moving files to trash via command line: How to open “Trash” through terminal?
            – wjandrea
            3 mins ago










          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',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f1086442%2fwhy-does-deleting-a-folder-from-the-command-line-take-longer-than-manual-deletio%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          10
          down vote













          When you delete from the GUI you are only moving the files to the trash bin. This updates the pointers to the files instantaneously saying that they now reside in the trash bin which is another folder.



          When you delete from the command line like that it is removing the files 1 by 1 until they are all gone from within the folder then removing the folder itself. This bypasses the trash bin. This also takes longer.



          If you do a Shift+Del in the GUI this will bypass the trash bin and take longer to delete.



          Hope this helps!






          share|improve this answer






















          • For moving files to trash via command line: How to open “Trash” through terminal?
            – wjandrea
            3 mins ago














          up vote
          10
          down vote













          When you delete from the GUI you are only moving the files to the trash bin. This updates the pointers to the files instantaneously saying that they now reside in the trash bin which is another folder.



          When you delete from the command line like that it is removing the files 1 by 1 until they are all gone from within the folder then removing the folder itself. This bypasses the trash bin. This also takes longer.



          If you do a Shift+Del in the GUI this will bypass the trash bin and take longer to delete.



          Hope this helps!






          share|improve this answer






















          • For moving files to trash via command line: How to open “Trash” through terminal?
            – wjandrea
            3 mins ago












          up vote
          10
          down vote










          up vote
          10
          down vote









          When you delete from the GUI you are only moving the files to the trash bin. This updates the pointers to the files instantaneously saying that they now reside in the trash bin which is another folder.



          When you delete from the command line like that it is removing the files 1 by 1 until they are all gone from within the folder then removing the folder itself. This bypasses the trash bin. This also takes longer.



          If you do a Shift+Del in the GUI this will bypass the trash bin and take longer to delete.



          Hope this helps!






          share|improve this answer














          When you delete from the GUI you are only moving the files to the trash bin. This updates the pointers to the files instantaneously saying that they now reside in the trash bin which is another folder.



          When you delete from the command line like that it is removing the files 1 by 1 until they are all gone from within the folder then removing the folder itself. This bypasses the trash bin. This also takes longer.



          If you do a Shift+Del in the GUI this will bypass the trash bin and take longer to delete.



          Hope this helps!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 hours ago

























          answered 5 hours ago









          Terrance

          17.9k23987




          17.9k23987











          • For moving files to trash via command line: How to open “Trash” through terminal?
            – wjandrea
            3 mins ago
















          • For moving files to trash via command line: How to open “Trash” through terminal?
            – wjandrea
            3 mins ago















          For moving files to trash via command line: How to open “Trash” through terminal?
          – wjandrea
          3 mins ago




          For moving files to trash via command line: How to open “Trash” through terminal?
          – wjandrea
          3 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1086442%2fwhy-does-deleting-a-folder-from-the-command-line-take-longer-than-manual-deletio%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay