How can I move the files contained in all subdirectories to the current directory, and then remove the empty subdirectories?
I found this question, but adapting the answer to:
mv * .
did not work; I received a lot of warnings looking like:
mv: wil and ./wil are identical
The files contained in the subdirectories have unique names.
-n, --no-clobber: do not overwrite an existing file. You might be interested in-b, --backup, too. – Florian Jenn Aug 17 '18 at 09:24find . -type f -mindepth 2 -exec mv -- {} . \;if you don't care about files which are overwritten. – Amir Pourmand Nov 30 '22 at 07:01