How can I copy a folder without altering their original dates of creation?

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











up vote
3
down vote

favorite












I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation










share|improve this question









New contributor




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



















  • Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
    – Ruslan
    32 mins ago














up vote
3
down vote

favorite












I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation










share|improve this question









New contributor




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



















  • Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
    – Ruslan
    32 mins ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation










share|improve this question









New contributor




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











I found an old archive filled with old folders on my pc.
I would like to know how to make a copy of this archive, but keeping everything intact, including their date of creation







command-line






share|improve this question









New contributor




MelanieDeschene 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




MelanieDeschene 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








edited 9 mins ago









Torquad333

31




31






New contributor




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









asked 3 hours ago









MelanieDeschene

161




161




New contributor




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





New contributor





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






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











  • Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
    – Ruslan
    32 mins ago
















  • Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
    – Ruslan
    32 mins ago















Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
– Ruslan
32 mins ago




Note that most Linux filesystems don't store dates of creation — the best you can have is date of last modification.
– Ruslan
32 mins ago










4 Answers
4






active

oldest

votes

















up vote
6
down vote













Read man cp, and, in addition to the --recursive switch use one of:



 -p same as --preserve=mode,ownership,timestamps

--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible
additional attributes: context, links, xattr, all





share|improve this answer



























    up vote
    2
    down vote













    sudo cp -rp /home/my_home /media/backup/my_home or
    sudo cp -a /home/my_home /media/backup/my_home



    This should do it.



    -r is recursive



    -p is preserve-mode






    share|improve this answer



























      up vote
      1
      down vote













      As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a (--archive) option with the cp command, which is specifically aimed at creating an identical archive copy.



      cp -a <source> <destination>



      The same can be achieved with the rsync utility, the local and remote file copy tool that may perform faster than cp. It also uses the option -a for the same purpose.



      rsync -a <source> <destination>



      For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive:



      cp -a /home/$USER/Archive /media/$USER/USB_drive/



      or



      rsync -a /home/$USER/Archive /media/$USER/USB_drive/



      • Both commands will create a folder Archive containing all your subfolders and files in the existing destination folder /media/$USER/USB_drive/.

      • You can find where your USB drive is mounted in the output of the command mount | grep /media

      • You can leave $USER in place if it is for your current user. This variable is automatically substituted by your login name.





      share|improve this answer



























        up vote
        0
        down vote













        simply copying an archive file won't change the created dates of the files/folders in the archive






        share|improve this answer








        New contributor




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

















        • Likely the OP is referring to an old archive folder, not to an archive file
          – vanadium
          2 hours 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
        );



        );






        MelanieDeschene 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%2faskubuntu.com%2fquestions%2f1085231%2fhow-can-i-copy-a-folder-without-altering-their-original-dates-of-creation%23new-answer', 'question_page');

        );

        Post as a guest






























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        6
        down vote













        Read man cp, and, in addition to the --recursive switch use one of:



         -p same as --preserve=mode,ownership,timestamps

        --preserve[=ATTR_LIST]
        preserve the specified attributes (default: mode,ownership,timestamps), if possible
        additional attributes: context, links, xattr, all





        share|improve this answer
























          up vote
          6
          down vote













          Read man cp, and, in addition to the --recursive switch use one of:



           -p same as --preserve=mode,ownership,timestamps

          --preserve[=ATTR_LIST]
          preserve the specified attributes (default: mode,ownership,timestamps), if possible
          additional attributes: context, links, xattr, all





          share|improve this answer






















            up vote
            6
            down vote










            up vote
            6
            down vote









            Read man cp, and, in addition to the --recursive switch use one of:



             -p same as --preserve=mode,ownership,timestamps

            --preserve[=ATTR_LIST]
            preserve the specified attributes (default: mode,ownership,timestamps), if possible
            additional attributes: context, links, xattr, all





            share|improve this answer












            Read man cp, and, in addition to the --recursive switch use one of:



             -p same as --preserve=mode,ownership,timestamps

            --preserve[=ATTR_LIST]
            preserve the specified attributes (default: mode,ownership,timestamps), if possible
            additional attributes: context, links, xattr, all






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 3 hours ago









            waltinator

            21k74168




            21k74168






















                up vote
                2
                down vote













                sudo cp -rp /home/my_home /media/backup/my_home or
                sudo cp -a /home/my_home /media/backup/my_home



                This should do it.



                -r is recursive



                -p is preserve-mode






                share|improve this answer
























                  up vote
                  2
                  down vote













                  sudo cp -rp /home/my_home /media/backup/my_home or
                  sudo cp -a /home/my_home /media/backup/my_home



                  This should do it.



                  -r is recursive



                  -p is preserve-mode






                  share|improve this answer






















                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    sudo cp -rp /home/my_home /media/backup/my_home or
                    sudo cp -a /home/my_home /media/backup/my_home



                    This should do it.



                    -r is recursive



                    -p is preserve-mode






                    share|improve this answer












                    sudo cp -rp /home/my_home /media/backup/my_home or
                    sudo cp -a /home/my_home /media/backup/my_home



                    This should do it.



                    -r is recursive



                    -p is preserve-mode







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 3 hours ago









                    Lewis Smith

                    887




                    887




















                        up vote
                        1
                        down vote













                        As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a (--archive) option with the cp command, which is specifically aimed at creating an identical archive copy.



                        cp -a <source> <destination>



                        The same can be achieved with the rsync utility, the local and remote file copy tool that may perform faster than cp. It also uses the option -a for the same purpose.



                        rsync -a <source> <destination>



                        For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive:



                        cp -a /home/$USER/Archive /media/$USER/USB_drive/



                        or



                        rsync -a /home/$USER/Archive /media/$USER/USB_drive/



                        • Both commands will create a folder Archive containing all your subfolders and files in the existing destination folder /media/$USER/USB_drive/.

                        • You can find where your USB drive is mounted in the output of the command mount | grep /media

                        • You can leave $USER in place if it is for your current user. This variable is automatically substituted by your login name.





                        share|improve this answer
























                          up vote
                          1
                          down vote













                          As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a (--archive) option with the cp command, which is specifically aimed at creating an identical archive copy.



                          cp -a <source> <destination>



                          The same can be achieved with the rsync utility, the local and remote file copy tool that may perform faster than cp. It also uses the option -a for the same purpose.



                          rsync -a <source> <destination>



                          For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive:



                          cp -a /home/$USER/Archive /media/$USER/USB_drive/



                          or



                          rsync -a /home/$USER/Archive /media/$USER/USB_drive/



                          • Both commands will create a folder Archive containing all your subfolders and files in the existing destination folder /media/$USER/USB_drive/.

                          • You can find where your USB drive is mounted in the output of the command mount | grep /media

                          • You can leave $USER in place if it is for your current user. This variable is automatically substituted by your login name.





                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a (--archive) option with the cp command, which is specifically aimed at creating an identical archive copy.



                            cp -a <source> <destination>



                            The same can be achieved with the rsync utility, the local and remote file copy tool that may perform faster than cp. It also uses the option -a for the same purpose.



                            rsync -a <source> <destination>



                            For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive:



                            cp -a /home/$USER/Archive /media/$USER/USB_drive/



                            or



                            rsync -a /home/$USER/Archive /media/$USER/USB_drive/



                            • Both commands will create a folder Archive containing all your subfolders and files in the existing destination folder /media/$USER/USB_drive/.

                            • You can find where your USB drive is mounted in the output of the command mount | grep /media

                            • You can leave $USER in place if it is for your current user. This variable is automatically substituted by your login name.





                            share|improve this answer












                            As indicated in the other answers, you need to use the terminal if you want to preserve every file attribute. However, I would suggest to use the -a (--archive) option with the cp command, which is specifically aimed at creating an identical archive copy.



                            cp -a <source> <destination>



                            The same can be achieved with the rsync utility, the local and remote file copy tool that may perform faster than cp. It also uses the option -a for the same purpose.



                            rsync -a <source> <destination>



                            For example, to copy a folder Archive in your home folder to an external USB drive mounted under /media/$USER/USB_drive:



                            cp -a /home/$USER/Archive /media/$USER/USB_drive/



                            or



                            rsync -a /home/$USER/Archive /media/$USER/USB_drive/



                            • Both commands will create a folder Archive containing all your subfolders and files in the existing destination folder /media/$USER/USB_drive/.

                            • You can find where your USB drive is mounted in the output of the command mount | grep /media

                            • You can leave $USER in place if it is for your current user. This variable is automatically substituted by your login name.






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 2 hours ago









                            vanadium

                            3,2881925




                            3,2881925




















                                up vote
                                0
                                down vote













                                simply copying an archive file won't change the created dates of the files/folders in the archive






                                share|improve this answer








                                New contributor




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

















                                • Likely the OP is referring to an old archive folder, not to an archive file
                                  – vanadium
                                  2 hours ago














                                up vote
                                0
                                down vote













                                simply copying an archive file won't change the created dates of the files/folders in the archive






                                share|improve this answer








                                New contributor




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

















                                • Likely the OP is referring to an old archive folder, not to an archive file
                                  – vanadium
                                  2 hours ago












                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote









                                simply copying an archive file won't change the created dates of the files/folders in the archive






                                share|improve this answer








                                New contributor




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









                                simply copying an archive file won't change the created dates of the files/folders in the archive







                                share|improve this answer








                                New contributor




                                ghweq 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




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









                                answered 2 hours ago









                                ghweq

                                1




                                1




                                New contributor




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





                                New contributor





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






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











                                • Likely the OP is referring to an old archive folder, not to an archive file
                                  – vanadium
                                  2 hours ago
















                                • Likely the OP is referring to an old archive folder, not to an archive file
                                  – vanadium
                                  2 hours ago















                                Likely the OP is referring to an old archive folder, not to an archive file
                                – vanadium
                                2 hours ago




                                Likely the OP is referring to an old archive folder, not to an archive file
                                – vanadium
                                2 hours ago










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









                                 

                                draft saved


                                draft discarded


















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












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











                                MelanieDeschene 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%2faskubuntu.com%2fquestions%2f1085231%2fhow-can-i-copy-a-folder-without-altering-their-original-dates-of-creation%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