I guess I'd make a lousy teacher because I don't know how to direct you toward working this out yourself, but please do study the manpages for
find and
mv to see why this works:
Code:
cd /path/to/top/directory
Top="$PWD"
find . -mindepth 2 -type f -name "*.tab" -exec mv --no-clobber --target-directory="$Top" {} +
With the "--no-clobber" it should be safe against losing anything, but it would still be wise to back up that wole tree in a
tar archive first.
And yes, I know that directing newcomers to study the
find manpage is really dropping them into the deep end of the pool.