Results 1 to 3 of 3

Thread: UNIX command line help needed on the "cp" command

  1. #1
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379

    UNIX command line help needed on the "cp" command

    i need help with the "cp" command.

    UNIX-based and UNIX-like systems will automatically OVERWRITE a file in the destination location from the source location IF the file is the same name.

    is there a way for me to do something like this?

    OVERWRITE the destination file ONLY IF the size of the source file and the size of the destination file are different. if the sizes are the same, don't overwrite and move on.

    anyone know? can anyone help?
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


  2. #2
    On the other hand.... You have different fingers
    Join Date
    Feb 2004
    Location
    San Francisco
    Posts
    3,548
    The -u switch is the closest I know of....

    -u, --update
    copy only when the SOURCE file is newer than the destination
    file or when the destination file is missing


    If that doesn't work, you might have to write a little script that will test for the variables you spoke of.


  3. #3
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379
    Quote Originally Posted by boyfunk
    The -u switch is the closest I know of....

    -u, --update
    copy only when the SOURCE file is newer than the destination
    file or when the destination file is missing


    If that doesn't work, you might have to write a little script that will test for the variables you spoke of.

    thanks for the info, chip. i ended up using the -u option
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •