Skip to main content
added 482 characters in body
Source Link
Stéphane Chazelas
  • 585.4k
  • 96
  • 1.1k
  • 1.7k

That's a typical job for cpio or pax:

find . -type f -mtime -14 -print0 | pax -0 -rw /ModifiedFiles

You could also use the -l option, to make links instead of copies. It doesn't work properly with the pax command on Debian, but maybe the one on OS/X doesn't have the same problem.

You can do something similar with cpio (an ancestor of pax), but the cpio implementation on OS/X doesn't seem to support a -0/--null option which would allow arbitrary file names. If you know your file names don't contain newline characters, you can still do:

find . -type f -mtime -14 | cpio -dp /ModifiedFiles

Both Debian (GNU) and OS/X versions of cpio also have a -l option to make links instead of copies. (and the one of Debian seems to work properly).

That's a typical job for cpio or pax:

find . -type f -mtime -14 -print0 | pax -0 -rw /ModifiedFiles

You could also use the -l option, to make links instead of copies. It doesn't work properly with the pax command on Debian, but maybe the one on OS/X doesn't have the same problem.

That's a typical job for cpio or pax:

find . -type f -mtime -14 -print0 | pax -0 -rw /ModifiedFiles

You could also use the -l option, to make links instead of copies. It doesn't work properly with the pax command on Debian, but maybe the one on OS/X doesn't have the same problem.

You can do something similar with cpio (an ancestor of pax), but the cpio implementation on OS/X doesn't seem to support a -0/--null option which would allow arbitrary file names. If you know your file names don't contain newline characters, you can still do:

find . -type f -mtime -14 | cpio -dp /ModifiedFiles

Both Debian (GNU) and OS/X versions of cpio also have a -l option to make links instead of copies. (and the one of Debian seems to work properly).

Source Link
Stéphane Chazelas
  • 585.4k
  • 96
  • 1.1k
  • 1.7k

That's a typical job for cpio or pax:

find . -type f -mtime -14 -print0 | pax -0 -rw /ModifiedFiles

You could also use the -l option, to make links instead of copies. It doesn't work properly with the pax command on Debian, but maybe the one on OS/X doesn't have the same problem.