Artificial intelligent assistant

Remove sub-folders without deleting files I have a directory below ( **Before** ). I would like to remove the Sub-folders and move the files to the Folder ( **After** ). How can I archive it? Thanks **Before** Folder |-----Sub-folder1 | |------ fileA.txt | |------ fileB.txt |-----Sub-folder2 |------ fileC.txt |------ fileD.txt **After** Folder |------ fileA.txt |------ fileB.txt |------ fileC.txt |------ fileD.txt

You can do this with


mv **/* .


Note: this will overwrite files with the same name

This requires `shopt -s globstar` as Quasimodo pointed out:

> If set, the pattern ** used in a pathname expansion context will match all files and zero or more directories and subdirectories. If the pattern is followed by a /, only directories and subdirectories match.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 1ccd66628cca77dacea2b87c0b772f09