P
P
Printip2017-09-23 17:52:41
linux
Printip, 2017-09-23 17:52:41

How to move millions of files into one folder?

Hello!
There are 20 folders (in the out folder), each folder has 100 thousand text files. Please tell me how without going into each folder (because the file system hangs) at once move all text files to one folder?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Olohtonov, 2017-09-23
@Printip

find src_dir -type f -exec mv "{}" dst_dir \;

D
Decadal, 2017-09-23
@Decadal

Linux: mv folder1/* folderFor10kkFiles/
moves all files from folder1 to folderFor10kkFiles
or like this:

find folder1/* ! -name '.' -exec mv {} folderFor10kkFiles \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question