I have a lot of directories that contain some text files and I would copy all files (of all directories) in a new directory. I'm looking for a bash command that do this. How can I do it?
You can use the this command to copy all the files and subfolders in a directory to another directory:
cp -a /source/. /dest/
Note: This does not solve OP's question as you cannot use it to only copy files of a certain type along with folders, but I'll leave it here for anyone that might need it.