How can I combine Find commands?

The question arose from my original question here.

I am trying to find common elements between the outputs of two find commands using the find command. How can I get the command to work?

find `find ~/bin/FilesDvorak/.* -maxdepth 0` -and `find ~/.PAST_RC_files/.*`

      

+1


a source to share


1 answer


Would instead have to use this job instead of reinventing the wheel instead?

diff -qrs ~/bin/FilesDvorak/ ~/.PAST_RC_files/ | grep -P "are identical|differ"

      

You can play with grep so that the files are only presented in one of the channels, etc.

differential



  • -q --brief Print only files different.
  • -r --recursive Recursively compare found subdirectories.
  • -s -report-same-files Report when two files match.

Grep

  • -P: Perl regular expression. You can probably handle it just fine, although I usually add it automatically.
+3


a source







All Articles