what to see what cpio would do without writing

Brian S
Brian S used Ask the Experts™
on
I have two similar directories and I want to compare them to see what would be copied.

Normall I would cd to a dir and then just run the command:

find . -print | cpio -pdvm /foo/bar

but I cannot recall and worse find in the man to set cpio to read-only -- meaning just show me what it would have done. My memory tells me that I used to be able to do this. But I might have dreamt it since I cannot recall the last time I actually used that option.

The OS today is OS X 10.8.2
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
I do not believe cpio has a no-action mode.

You might be thinking of diff

Diff -BruN directory_origin directory_destination
The output will be a what changes need to be made to the origin directory contents to make it identical to the destination one.
Files should be regular files.

If you run the cpio you included, you will output the list of files that are copied.
You could also use the "dry run" option of rsync:
rsync -nrv directory_origin directory_destination

Open in new window

:p
Brian Sretired geek

Author

Commented:
Sorry for long delay -- holidays got in the way

both the diff and rsync would have worked -- but the rsync is more of what I was looking for

must have dreamt the cpio part

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial