Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
114
rated 0 times [  114] [ 0]  / answers: 1 / hits: 100801  / 2 Years ago, fri, august 5, 2022, 1:56:37

I've bunch of folders in folder A. I want to move files from all those folders to A.



Or



I want to cut all files from child folders and paste them in parent folder.



How to do that?


More From » bash

 Answers
4

Go to your A directory and run



find . -mindepth 2 -type f -print -exec mv {} . ;


which means "find all files in this directory and its sub-directories and execute mv with target directory . for each file found to move them to current directory.


[#37862] Sunday, August 7, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
repend

Total Points: 195
Total Questions: 113
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
3 Years ago
repend questions
Thu, May 11, 23, 09:38, 1 Year ago
Thu, Jan 5, 23, 21:41, 1 Year ago
Mon, Nov 22, 21, 19:37, 3 Years ago
Mon, Jan 24, 22, 11:26, 2 Years ago
;