[PATCH] adding two new options to 'cp'

Tim Kientzle kientzle at freebsd.org
Sat Jul 29 20:30:08 UTC 2006

Eric Anderson wrote:
> So, you can mimic an entire tree with something like:
> cp -al /from/ /to/

  pax -rwl -pe /from /to

is almost what you want.  (It requires
that /to exist first, though.)

If you want to match the 'cp' semantics when /to does
not exist, you can use pax's rewrite option:

  pax -rwl -pe -s|/from|/to| /from /

As a bonus, this works on any machine
that meets POSIX, unlike every other option
that's been mentioned in this thread (tar and
cpio were both dropped from the POSIX standard
a decade ago).


More information about the freebsd-hackers mailing list