When taking screenshots on MacOS, the second monitor content is in file xxxx(2).png
If a user (poweruser on Windows but newbie on MacOS) wants a script that moves all screenshot with *(2).* to folder "two", how is it done via script/command line?
The command below does not work. It moves all files and the user needs just half of the files moved.
mkdir two
mv *(2).* two
What is the correct mv command?
Files containing (2) fragment in file name (at the end of the name) need to be moved.
Example of file name from second monitor is 'ssht 2022-04-27 at 12.19.55 PM (2).png'. That need to be moved.
Example of file from first monitor is ssht 2022-04-27 at 12.19.55 PM.png
(and ideally making it clickable/executable (chmod or .command or bash mymovecmd.sh)
man mv does not talk at all about any star notation for moving files. Not sure if mv on macos suports globbing and how to use it. https://stackoverflow.com/questions/28176590/what-do-double-asterisk-wildcards-mean
mkdir two;find . -name '*(2)*' -exec mv '{}' two \;but I have little idea why is this correct