Reputation: 2583
I have the following folder structure:
Folder1 --FolderA --Gex_experiments --FolderB --Gex_experiments --FolderC --Gex_experiments ....... --FolderAYCD --Gex_experiments
In each Gex_experiments folder there's a *_GEX.txt file I would like to move to FolderA in the case of Gex_experiments folder under FolderA, to FolderB in the case of Gex_experiments folder under FolderB and so on.
Can anyone help me please?
Best!
Upvotes: 0
Views: 86
Reputation: 68
From folder1 you can run:
for file in *; do
if [ -d $file ]; then
cd $file; mv Gex_experiments/*_GEX.txt ./; cd ..;
fi
done
Upvotes: 1