[Chicago-talk] Merging two dir's into a third
Mike Pastore
mike at oobak.org
Wed Feb 18 17:23:36 CST 2004
Am I missing something??
$ mkdir -p dira/apple dirb/apple dirc
$ touch dira/apple/this.txt dirb/apple/that.txt
$ cp -r dira/* dirb/* dirc/
$ ls dirc/apple/
that.txt this.txt
Use `cp -i' for prompting. Use `cp -f' and change your directory order
to prioritize one directory over another (ie, copy dirb first then
overwrite it with dira).
--
Mike Pastore
mike at oobak.org
On Wed, 2004-02-18 at 17:20, Steven Lembark wrote:
> -- Don Drake <don at drakeconsult.com>
>
> > However, my example will return 0 if the disk fills, because the command
> > "tar cvf - *" was successful, and the rest of the commands were piped and
> > failed.
> >
> > Wrapping the entire line in parentheses "(tar cvf - * | (cd ../dirc; tar
> > xvf -) )" would fix that.
>
> Or using "find . | cpio -pdv". This is a bit more
> effecient also because you don't need to encode and
> decode the file or move it over the pipe through
> kernel buffers.
>
>
> --
> Steven Lembark 2930 W. Palmer
> Workhorse Computing Chicago, IL 60647
> +1 888 359 3508
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
More information about the Chicago-talk
mailing list