The -t target form of the mv command is handy for situations like this where you want to move multiple source files to one destination.
Code:
-t, --target-directory=DIRECTORY
move all SOURCE arguments into DIRECTORY
If the target directories already exist, you should be able to do something like
Code:
mv -t /home/adam/Music/AFI/ /home/adam/Music/All/*afi*
or (if you want to restrict the match more precisely)
Code:
mv -t /home/adam/Music/AFI/ /home/adam/Music/All/album-afi*.mp3
or even (to match only names that have one or more digits after the afi)
Code:
mv -t /home/adam/Music/AFI/ /home/adam/Music/All/album-afi+([0-9]).mp3
and so on. If the directories don't already exist, there are ways of generating them progamatically (i.e. by chopping up the filenames) but that's a bit more complicated.
EDIT: and no need to use sudo if the files and target directories are under your own home dir
Bookmarks