In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were...

How do you funnel food off a cutting board?

After checking in online, how do I know whether I need to go show my passport at airport check-in?

How do you get out of your own psychology to write characters?

How would an AI self awareness kill switch work?

Does the ditching switch allow an A320 to float indefinitely?

Calculate of total length of edges in Voronoi diagram

Can the "Friends" spell be used without making the target hostile?

How do I prevent a homebrew Grappling Hook feature from trivializing Tomb of Annihilation?

Is a new boolean field better than null reference when a value can be meaningfully absent?

Why do we have to make "peinlich" start with a capital letter and also end with -s in this sentence?

How to deal with possible delayed baggage?

What game did these black and yellow dice come from?

Does a paladin have to announce that they're using Divine Smite before attacking?

Am I correct in stating that the study of topology is purely theoretical?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Possible issue with my W4 and tax return

Equivalent of "illegal" for violating civil law

What makes papers publishable in top-tier journals?

Boss asked me to sign a resignation paper without a date on it along with my new contract

Not a Long-Winded Riddle

"Starve to death" Vs. "Starve to the point of death"

Non-Cancer terminal illness that can affect young (age 10-13) girls?

What is the wife of a henpecked husband called?

What's the oldest plausible frozen specimen for a Jurassic Park style story-line?



In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?


Any way to sync directory structure when the files are already on both sides?rsync: delete only extraneous files with a timestamp earlier than the newest in the source directoryLinux Shell script to copy files from one location to another locationhow to check for duplicates and rename file if there are any while copying them from another sourcemoving files from one location to another while they are being usedHow to delete duplicate files of two folders?What happens in linux when you copy a hardlink on top of another hardlink to the same file?What happens if I edit a folder while copying it?ZIP: What are the temporary binary files which names start with `zi`?What happens if you delete a file while it was moving from one filesystem(ext4) to another(NTFS)?













1















In Linux what happens if 1000 files in a directory are moved to another location and another 300 files were added to the source directory while original 1000 files were being moved. Will the destination end up being 1300 files? or will there be 300 files remaining in the source folder.










share|improve this question







New contributor




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

























    1















    In Linux what happens if 1000 files in a directory are moved to another location and another 300 files were added to the source directory while original 1000 files were being moved. Will the destination end up being 1300 files? or will there be 300 files remaining in the source folder.










    share|improve this question







    New contributor




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























      1












      1








      1








      In Linux what happens if 1000 files in a directory are moved to another location and another 300 files were added to the source directory while original 1000 files were being moved. Will the destination end up being 1300 files? or will there be 300 files remaining in the source folder.










      share|improve this question







      New contributor




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












      In Linux what happens if 1000 files in a directory are moved to another location and another 300 files were added to the source directory while original 1000 files were being moved. Will the destination end up being 1300 files? or will there be 300 files remaining in the source folder.







      linux filesystems operating-systems






      share|improve this question







      New contributor




      Shayan Ahmad 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 question







      New contributor




      Shayan Ahmad 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 question




      share|improve this question






      New contributor




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









      asked 1 hour ago









      Shayan AhmadShayan Ahmad

      62




      62




      New contributor




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





      New contributor





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






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






















          2 Answers
          2






          active

          oldest

          votes


















          2














          This depends on which tools you use: Let's check a few cases:



          If you run something along the lines of mv /path/to/source/* /path/to/dest/ int a shell, you will end up with the original 1000 files being moved, the new 300 being untouched. This comes from the fact, that the shell will expand the * before starting the move operation, so when the move is in progress, the list is already fixed.



          If you use Nautilus (and other GUI friends), you will end up the same way: It will run the move operation based on which files were selected - this doesn't change when new files show up.



          If you use your own program using syscalls along the line of loop over glob and only one mv until glob stays empty, you will end up with all 1300 files in the new directory. This is because every new glob will pick up the new files, that have showed up in the meantime.






          share|improve this answer
























          • What happens if you opendir() the source, then loop over readdir() or getdents()?

            – grawity
            1 hour ago





















          1














          When you tell the system to move all the files from a directory, it lists all the files and then starts moving them. If new files appear in the directory, they aren't added to the list of files to move, so they'll remain in the original location.



          You can, of course, program a way of moving files different to mv which will periodically check for new files in the source directory.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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
            });


            }
            });






            Shayan Ahmad is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1409532%2fin-linux-what-happens-if-1000-files-in-a-directory-are-moved-to-another-location%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            This depends on which tools you use: Let's check a few cases:



            If you run something along the lines of mv /path/to/source/* /path/to/dest/ int a shell, you will end up with the original 1000 files being moved, the new 300 being untouched. This comes from the fact, that the shell will expand the * before starting the move operation, so when the move is in progress, the list is already fixed.



            If you use Nautilus (and other GUI friends), you will end up the same way: It will run the move operation based on which files were selected - this doesn't change when new files show up.



            If you use your own program using syscalls along the line of loop over glob and only one mv until glob stays empty, you will end up with all 1300 files in the new directory. This is because every new glob will pick up the new files, that have showed up in the meantime.






            share|improve this answer
























            • What happens if you opendir() the source, then loop over readdir() or getdents()?

              – grawity
              1 hour ago


















            2














            This depends on which tools you use: Let's check a few cases:



            If you run something along the lines of mv /path/to/source/* /path/to/dest/ int a shell, you will end up with the original 1000 files being moved, the new 300 being untouched. This comes from the fact, that the shell will expand the * before starting the move operation, so when the move is in progress, the list is already fixed.



            If you use Nautilus (and other GUI friends), you will end up the same way: It will run the move operation based on which files were selected - this doesn't change when new files show up.



            If you use your own program using syscalls along the line of loop over glob and only one mv until glob stays empty, you will end up with all 1300 files in the new directory. This is because every new glob will pick up the new files, that have showed up in the meantime.






            share|improve this answer
























            • What happens if you opendir() the source, then loop over readdir() or getdents()?

              – grawity
              1 hour ago
















            2












            2








            2







            This depends on which tools you use: Let's check a few cases:



            If you run something along the lines of mv /path/to/source/* /path/to/dest/ int a shell, you will end up with the original 1000 files being moved, the new 300 being untouched. This comes from the fact, that the shell will expand the * before starting the move operation, so when the move is in progress, the list is already fixed.



            If you use Nautilus (and other GUI friends), you will end up the same way: It will run the move operation based on which files were selected - this doesn't change when new files show up.



            If you use your own program using syscalls along the line of loop over glob and only one mv until glob stays empty, you will end up with all 1300 files in the new directory. This is because every new glob will pick up the new files, that have showed up in the meantime.






            share|improve this answer













            This depends on which tools you use: Let's check a few cases:



            If you run something along the lines of mv /path/to/source/* /path/to/dest/ int a shell, you will end up with the original 1000 files being moved, the new 300 being untouched. This comes from the fact, that the shell will expand the * before starting the move operation, so when the move is in progress, the list is already fixed.



            If you use Nautilus (and other GUI friends), you will end up the same way: It will run the move operation based on which files were selected - this doesn't change when new files show up.



            If you use your own program using syscalls along the line of loop over glob and only one mv until glob stays empty, you will end up with all 1300 files in the new directory. This is because every new glob will pick up the new files, that have showed up in the meantime.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 1 hour ago









            Eugen RieckEugen Rieck

            10.3k22228




            10.3k22228













            • What happens if you opendir() the source, then loop over readdir() or getdents()?

              – grawity
              1 hour ago





















            • What happens if you opendir() the source, then loop over readdir() or getdents()?

              – grawity
              1 hour ago



















            What happens if you opendir() the source, then loop over readdir() or getdents()?

            – grawity
            1 hour ago







            What happens if you opendir() the source, then loop over readdir() or getdents()?

            – grawity
            1 hour ago















            1














            When you tell the system to move all the files from a directory, it lists all the files and then starts moving them. If new files appear in the directory, they aren't added to the list of files to move, so they'll remain in the original location.



            You can, of course, program a way of moving files different to mv which will periodically check for new files in the source directory.






            share|improve this answer




























              1














              When you tell the system to move all the files from a directory, it lists all the files and then starts moving them. If new files appear in the directory, they aren't added to the list of files to move, so they'll remain in the original location.



              You can, of course, program a way of moving files different to mv which will periodically check for new files in the source directory.






              share|improve this answer


























                1












                1








                1







                When you tell the system to move all the files from a directory, it lists all the files and then starts moving them. If new files appear in the directory, they aren't added to the list of files to move, so they'll remain in the original location.



                You can, of course, program a way of moving files different to mv which will periodically check for new files in the source directory.






                share|improve this answer













                When you tell the system to move all the files from a directory, it lists all the files and then starts moving them. If new files appear in the directory, they aren't added to the list of files to move, so they'll remain in the original location.



                You can, of course, program a way of moving files different to mv which will periodically check for new files in the source directory.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                chorobachoroba

                13.3k13341




                13.3k13341






















                    Shayan Ahmad is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    Shayan Ahmad is a new contributor. Be nice, and check out our Code of Conduct.













                    Shayan Ahmad is a new contributor. Be nice, and check out our Code of Conduct.












                    Shayan Ahmad is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1409532%2fin-linux-what-happens-if-1000-files-in-a-directory-are-moved-to-another-location%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

                    Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

                    Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

                    How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...