The following command finds recursively all files containing foo
(but not bar
) and preserves the directory structure in the target directory, for example if I have /path/to/2017/foo.ps
and /path/to/2018/foo.pdf
it creates the subdirectories 2017
and 2018
under ~/path/to/dir/
containing foo.ps
resp. foo.pdf
.
find . -iname \*foo\*pdf -exec rsync -R --exclude='*bar*' {} ~/path/to/dir/ \;
What is the equivalent to this command such that I end up with hardlinks instead of copies?