I'm still relatively new to Linux, so take it easy on a noob, eh?
I have scripts set up to move media files to a specific directory based on its name. I used a wildcard to accomplish this, but I need to make it more specific so that it only moves exactly what I want.
Example: mv /home/user/Downloads/*Horror* /home/user/Downloads/transmission/completed/Series/AHS/
I need to know if it's possible to include multiple wildcards to a single move command. In the preceeding example, I want the script to move all of the American Horror Story episodes to the AHS directory. The script works, but if I download anything else with the word 'horror' in it, that file will be moved as well.
Is what I'm asking possible, or is there a different method all together that I should be using?
31 Answer
Try using a wild card like *American*Horror*. You can also have additional wildcards in the source path such as /usr/home/D*/*American*Horror*. Depending what is in your downloads directory a simple patter like *A*H* may match the desired files.
You may be able to use pattern matching such as *[aA]merican*[hH]orror*.
I generally either echo the command by prefixing it with echo, or use ls list files matching the pattern before running the actual command. This gives an opportunity to tune the pattern before committing to action.