6/21/2023 0 Comments Diff files mac![]() This list gives me a good feel for the big picture before I start overwriting things: which files or subdirectories can be deleted, which can be synced (and in which direction) using rsync, and which should be carefully checked before replacing, in case changes need to be merged. Pipe the output through grep to remove mention of uninteresting files, and sort to tidy it up, e.g.:ĭiff -qr dirA dirB | grep -v -e 'DS_Store' -e 'Thumbs' | This command will provide a nice list of files that occur in dirA but not in dirB, files that occur in dirB, but not in dirA, and files that differ between dirA and dirB. The trick is to use the -q option to suppress line-by-line comparisons in files that differ: In addition to rsync, one useful tool is the unix diff command.Īs mentioned in other hints, diff can not only compare two files, it can, by using the -r option, walk entire directory trees, recursively checking differences between subdirectories and files that occur at comparable points in each tree. ![]() ![]() I like to keep the home directories on my work (PC) and home (Mac) machines more-or-less in sync using a hard drive that I tote back and forth every few weeks.
0 Comments
Leave a Reply. |