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?
Asked
Active
Viewed 359 times
2 Answers
0
You can use the this command to copy all the files and subfolders in a directory to another directory:
cp -a /source/. /dest/
Taken from How can I copy the contents of a folder to another folder in a different directory using terminal?
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.