find, sed, and xargs in the same command line
How geeky can you get?
A simple problem for some shell fun: I get handed a folder full of folders, each of the child folders containing one font file (.otf file). The child folders names contain spaces. I want all those .otf files in one single folder, but I don't want to go through all the folders with the mouse and drag and drop them over (that's so 1980s).
Instead I spent some time (probably more than drag and dropping would have taken) to try and assemble this puppy of a command line:
find . -name *.otf -print | sed -e 's/.*/"&"/' | xargs -J % mv % ../mpr/
With find, sed, and xargs all in the same one liner, total command line geek fun ensues!