+1 vote
in Other by
How do I bash a command or a shell script to move all the files from the subdirectories to one target directory in Linux?

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you are using GNU mv, the -t option (target directory) is pretty useful:

find sourcedir -type f -print0 | xargs -0 mv -t target

man mv gives more details.

Related questions

+1 vote
asked Jan 30, 2022 in Other by DavidAnderson
+1 vote
asked Feb 1, 2022 in Other by DavidAnderson
...