How do I move all files that only have three characters in the extension to the parent directory?
E.g. I want to move all the .mp3 and .zip but not all the .sh to the parent directory.
11 Answer
mv *.mp3 *.zip /destination/if you really meant 3 characters:
mv *.??? /destinationbut this will also do .xml or .mov or .mp4.
Tip: you can use ls to see what files are shown that will be moved when using mv
If you want to move large numbers of files use...
find . -maxdepth 1 -iname '*.mp3' -exec mv -t /destination/ {} + 5