Announcement

Collapse
No announcement yet.

copy all directories, no to all overwrite files [SOLVED]

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    copy all directories, no to all overwrite files [SOLVED]

    hi, I want to copy a dir into another one, and all directories inside them, but I do not want to overwrite the similar files.
    what is the command?
    should I use cp -r for recursively? but how not to overwite the files
    Cheers, -Linda

    #2
    Re: copy all directories, no to all overwrite files

    use dolphin, and when asked select writein to and don't overwrite

    cp -r will overwrite the files. iirc
    Mark Your Solved Issues [SOLVED]
    (top of thread: thread tools)

    Comment


      #3
      Re: copy all directories, no to all overwrite files

      thx but i know on dolphin, but I want to learn it in command line as well...
      Cheers, -Linda

      Comment


        #4
        Re: copy all directories, no to all overwrite files

        Depending on what you want,' cp -ru' might be an option. -u (or --update) only copies files that are newer in the SOURCE or don't exist in DEST.

        If you want something fancier, rsync is more versatile than cp.

        Comment


          #5
          Re: copy all directories, no to all overwrite files

          Did anybody look at cp's man page?



          cp -rn /source /destination
          we see things not as they are, but as we are.
          -- anais nin

          Comment


            #6
            Re: copy all directories, no to all overwrite files

            Originally posted by wizard10000
            Did anybody look at cp's man page?



            cp -rn /source /destination
            Sure, but I understood this:
            Originally posted by lindaonline15
            but I do not want to overwrite the similar files.
            to mean that changed files (even with the same filename) should be overwritten (I could have misunderstood the question, though).

            If simple "never overwrite" is what's needed , then -rn is the way to go.

            Comment


              #7
              Re: copy all directories, no to all overwrite files

              Maybe I should read the post instead of the man page
              we see things not as they are, but as we are.
              -- anais nin

              Comment


                #8
                Re: copy all directories, no to all overwrite files

                Without any options cp silently overwrites same name files. If you want to be prompted before overwriting, then use --interactive.

                The -n option wizard10000 mentioned is new. It doesn't exist in Ubuntu releases before 10.04.

                For more details please consult the manpage and GNU Coreutils documents.

                HTH
                Welcome newbies!
                Verify the ISO
                Kubuntu's documentation

                Comment


                  #9
                  Re: copy all directories, no to all overwrite files

                  thank you all. helped alot
                  Cheers, -Linda

                  Comment

                  Working...
                  X