0

Finding *.mkv and *.mp4 works

find /home6/movies/ -name '*.mp4' -o -name '*.mkv'

but moving them for some reason partially fails and moves only mkv files

find /home6/movies/ -name '*.mp4' -o -name '*.mkv' -exec mv {} /home6/archive/ \;

Am I using an incorrect find switch "-o" for this task?

Andy
  • 583
  • 2
  • 9
  • 23

1 Answers1

3

Looks like you need to surround the or expression in parentheses so the exec applies to both matches.

This is a similar question: `find -name` pattern that matches multiple patterns

find /home6/movies/ \( -name '*.mp4' -o -name '*.mkv' \) -exec mv {} /home6/archive/ \;
Santiago Bruno
  • 461
  • 2
  • 9