Methods to copy a file or a folder one linux server to another linux server [on hold]

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











up vote
0
down vote

favorite












What is the most accurate way to copy a file or a folder from one linux machine to another using commands?










share|improve this question















put on hold as too broad by Romeo Ninov, Jesse_b, RalfFriedl, Thomas Dickey, mosvy yesterday


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
    – Jesse_b
    yesterday














up vote
0
down vote

favorite












What is the most accurate way to copy a file or a folder from one linux machine to another using commands?










share|improve this question















put on hold as too broad by Romeo Ninov, Jesse_b, RalfFriedl, Thomas Dickey, mosvy yesterday


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
    – Jesse_b
    yesterday












up vote
0
down vote

favorite









up vote
0
down vote

favorite











What is the most accurate way to copy a file or a folder from one linux machine to another using commands?










share|improve this question















What is the most accurate way to copy a file or a folder from one linux machine to another using commands?







linux file-copy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Jeff Schaller

35.9k952119




35.9k952119










asked yesterday









Janith

52




52




put on hold as too broad by Romeo Ninov, Jesse_b, RalfFriedl, Thomas Dickey, mosvy yesterday


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by Romeo Ninov, Jesse_b, RalfFriedl, Thomas Dickey, mosvy yesterday


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
    – Jesse_b
    yesterday












  • 1




    Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
    – Jesse_b
    yesterday







1




1




Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
– Jesse_b
yesterday




Possible duplicate of Use scp to transfer a file from local directory X to remote directory Y
– Jesse_b
yesterday










2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










There are various options like ftp, rsync etc. but the most useful of these is the scp which comes preinstalled with openssh package. Syntax is simple: scp file.txt user@host:/folder/to/which/user/has/permissions.



There are some other flags, for example, if you are using a different port other than 22 for ssh, you'd need to mention that in the command with -P option.



scp -P PORT file.txt user@host:/folder/to/which/user/has/permissions



For directories, it is advised to archive folder(s) in some container (most easy is .tar; tar -cvf myfolder.tar folder1 folder2 folderN) and then use scp to send it across to another Linux machine (just replace file.txt with myfolder.tar)






share|improve this answer





























    up vote
    0
    down vote













    rsync -a should be as accurate as accuracy can get. 
    -a stands for the archive mode. 
    A good description is given in its man page:




      rsync -avz foo:src/bar /data/tmp


      This would recursively transfer all files from the directory src/bar on
      the machine foo into the /data/tmp/bar directory on the local machine. 
      The files are transferred in "archive" mode, which ensures that
      symbolic links, devices, attributes, permissions, ownerships, etc. are
      preserved in the transfer.  Additionally, compression will be used to
      reduce the size of data portions of the transfer.




      The compression flag is -z and -v switches verbosity on. 
      Study the man page to find out much more.






      share|improve this answer





























        2 Answers
        2






        active

        oldest

        votes








        2 Answers
        2






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        0
        down vote



        accepted










        There are various options like ftp, rsync etc. but the most useful of these is the scp which comes preinstalled with openssh package. Syntax is simple: scp file.txt user@host:/folder/to/which/user/has/permissions.



        There are some other flags, for example, if you are using a different port other than 22 for ssh, you'd need to mention that in the command with -P option.



        scp -P PORT file.txt user@host:/folder/to/which/user/has/permissions



        For directories, it is advised to archive folder(s) in some container (most easy is .tar; tar -cvf myfolder.tar folder1 folder2 folderN) and then use scp to send it across to another Linux machine (just replace file.txt with myfolder.tar)






        share|improve this answer


























          up vote
          0
          down vote



          accepted










          There are various options like ftp, rsync etc. but the most useful of these is the scp which comes preinstalled with openssh package. Syntax is simple: scp file.txt user@host:/folder/to/which/user/has/permissions.



          There are some other flags, for example, if you are using a different port other than 22 for ssh, you'd need to mention that in the command with -P option.



          scp -P PORT file.txt user@host:/folder/to/which/user/has/permissions



          For directories, it is advised to archive folder(s) in some container (most easy is .tar; tar -cvf myfolder.tar folder1 folder2 folderN) and then use scp to send it across to another Linux machine (just replace file.txt with myfolder.tar)






          share|improve this answer
























            up vote
            0
            down vote



            accepted







            up vote
            0
            down vote



            accepted






            There are various options like ftp, rsync etc. but the most useful of these is the scp which comes preinstalled with openssh package. Syntax is simple: scp file.txt user@host:/folder/to/which/user/has/permissions.



            There are some other flags, for example, if you are using a different port other than 22 for ssh, you'd need to mention that in the command with -P option.



            scp -P PORT file.txt user@host:/folder/to/which/user/has/permissions



            For directories, it is advised to archive folder(s) in some container (most easy is .tar; tar -cvf myfolder.tar folder1 folder2 folderN) and then use scp to send it across to another Linux machine (just replace file.txt with myfolder.tar)






            share|improve this answer














            There are various options like ftp, rsync etc. but the most useful of these is the scp which comes preinstalled with openssh package. Syntax is simple: scp file.txt user@host:/folder/to/which/user/has/permissions.



            There are some other flags, for example, if you are using a different port other than 22 for ssh, you'd need to mention that in the command with -P option.



            scp -P PORT file.txt user@host:/folder/to/which/user/has/permissions



            For directories, it is advised to archive folder(s) in some container (most easy is .tar; tar -cvf myfolder.tar folder1 folder2 folderN) and then use scp to send it across to another Linux machine (just replace file.txt with myfolder.tar)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered yesterday









            sla3k

            3134




            3134






















                up vote
                0
                down vote













                rsync -a should be as accurate as accuracy can get. 
                -a stands for the archive mode. 
                A good description is given in its man page:




                  rsync -avz foo:src/bar /data/tmp


                  This would recursively transfer all files from the directory src/bar on
                  the machine foo into the /data/tmp/bar directory on the local machine. 
                  The files are transferred in "archive" mode, which ensures that
                  symbolic links, devices, attributes, permissions, ownerships, etc. are
                  preserved in the transfer.  Additionally, compression will be used to
                  reduce the size of data portions of the transfer.




                  The compression flag is -z and -v switches verbosity on. 
                  Study the man page to find out much more.






                  share|improve this answer


























                    up vote
                    0
                    down vote













                    rsync -a should be as accurate as accuracy can get. 
                    -a stands for the archive mode. 
                    A good description is given in its man page:




                      rsync -avz foo:src/bar /data/tmp


                      This would recursively transfer all files from the directory src/bar on
                      the machine foo into the /data/tmp/bar directory on the local machine. 
                      The files are transferred in "archive" mode, which ensures that
                      symbolic links, devices, attributes, permissions, ownerships, etc. are
                      preserved in the transfer.  Additionally, compression will be used to
                      reduce the size of data portions of the transfer.




                      The compression flag is -z and -v switches verbosity on. 
                      Study the man page to find out much more.






                      share|improve this answer
























                        up vote
                        0
                        down vote










                        up vote
                        0
                        down vote









                        rsync -a should be as accurate as accuracy can get. 
                        -a stands for the archive mode. 
                        A good description is given in its man page:




                          rsync -avz foo:src/bar /data/tmp


                          This would recursively transfer all files from the directory src/bar on
                          the machine foo into the /data/tmp/bar directory on the local machine. 
                          The files are transferred in "archive" mode, which ensures that
                          symbolic links, devices, attributes, permissions, ownerships, etc. are
                          preserved in the transfer.  Additionally, compression will be used to
                          reduce the size of data portions of the transfer.




                          The compression flag is -z and -v switches verbosity on. 
                          Study the man page to find out much more.






                          share|improve this answer














                          rsync -a should be as accurate as accuracy can get. 
                          -a stands for the archive mode. 
                          A good description is given in its man page:




                            rsync -avz foo:src/bar /data/tmp


                            This would recursively transfer all files from the directory src/bar on
                            the machine foo into the /data/tmp/bar directory on the local machine. 
                            The files are transferred in "archive" mode, which ensures that
                            symbolic links, devices, attributes, permissions, ownerships, etc. are
                            preserved in the transfer.  Additionally, compression will be used to
                            reduce the size of data portions of the transfer.




                            The compression flag is -z and -v switches verbosity on. 
                            Study the man page to find out much more.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited yesterday









                            G-Man

                            12.2k92861




                            12.2k92861










                            answered yesterday









                            Tomasz

                            8,72552862




                            8,72552862












                                Popular posts from this blog

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

                                Displaying single band from multi-band raster using QGIS

                                How many registers does an x86_64 CPU actually have?