Score:0

Move huge amount of files with directory creating

in flag

There is src directory with sub-dirs as

/tmp/part1
/tmp/part2
/tmp/part3

Sub dirs contains huge amount of wav-files

I need to move wav-files to /dst directory so that subdir1,subdir2,etc would be created in /dst and file moved to neccessary sub-dir in dst directory.

Because of huge amount i do:

$source="/tmp"
$dst= "/dst"

find $source -name "*.wav" -exec mv  {} $dst \;

But all files are moved to /dst , not by subdir. Is it possible to create subdirs "on-the-fly" ?

in flag
I do not understand why you’re not using `cp -R` for this …
harp1814 avatar
in flag
Because i need to delete files in src path. But it neccessary to be sure, that files are copied succesfully
sudodus avatar
jp flag
I would use `rsync`, which is very reliable and can also exclude files (sets of files) with the option `--exclude`. You can use the 'archive' option `-a`. But it copies, does not move, so you should delete files from the original location (*but first* make sure that the copying was successful).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.