9
rated 0 times
[
9]
[
0]
/ answers: 1 / hits: 1323
/ 3 Years ago, tue, november 2, 2021, 8:21:15
I have a directory containing many similar subdirectories
Each of these subdirectories have some files I am interested in and some that I am not.
I want to copy:
FROM:
two particular files: file1.txt file2.json from every subdirectory
TO: a different location
But making the subdirectories in that location
For example
If I have
base
|_folder_00000001
| |_-file1.txt
| |_ file2.json
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_00000002
| |_-file1.txt
| |_ file2.json
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_00000003
| |_-file1.txt
| |_ file2.json
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
|_folder_00000004
| |_-file1.txt
| |_ file2.json
| |_some_other_things_I_dont_need
| |_some_other_folder_I_dont_need
|
I want to copy this to another location but excluding the "some other things and folders I dont need"
target
|_folder_00000001
| |_-file1.txt
| |_ file2.json
|
|
|_folder_00000002
| |_-file1.txt
| |_ file2.json
| |
|_folder_00000003
| |_-file1.txt
| |_ file2.json
| |
|_folder_00000004
| |_-file1.txt
| |_ file2.json
|
How can I do this from the bash terminal?
More From » command-line