Why deleting a folder from command line takes longer time than manual deletion?

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











up vote
1
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 delete manually 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
    1
    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 delete manually 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
      1
      down vote

      favorite









      up vote
      1
      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 delete manually 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 delete manually 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 4 hours ago









      Yufenyuy Veyeh Dider

      1,1691823




      1,1691823










      asked 4 hours ago









      Billal Begueradj

      4284827




      4284827




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          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






















            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-deleting-a-folder-from-command-line-takes-longer-time-than-manual-deletion%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
            4
            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


























              up vote
              4
              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
























                up vote
                4
                down vote










                up vote
                4
                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 3 hours ago

























                answered 4 hours ago









                Terrance

                17.9k23986




                17.9k23986



























                     

                    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-deleting-a-folder-from-command-line-takes-longer-time-than-manual-deletion%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery