Bash command to move only some files?

Viewed 1021

Let's say I have the following files in my current directory:

1.jpg
1original.jpg
2.jpg
2original.jpg
3.jpg
4.jpg

Is there a terminal/bash/linux command that can do something like

if the file [an integer]original.jpg exists,
    then move [an integer].jpg and [an integer]original.jpg to another directory.

Executing such a command will cause 1.jpg, 1original.jpg, 2.jpg and 2original.jpg to be in their own directory.

NOTE This doesn't have to be one command. I can be a combination of simple commands. Maybe something like copy original files to a new directory. Then do some regular expression filter on files in the newdir to get a list of file names from old directory that still need to be copied over etc..

6 Answers
Related