I want to move files bigger than "300Mb" from one directory tree where each file is located in subfolders
Example: I have a directory structure:
dirA/
dirA/file1
dirA/x/
dirA/x/file2
dirA/y/
dirA/y/file3
Here is the expected result, a "move" of the directory tree where each file is a moved to the sub folders:
dirB/ # normal directory
dirB/file1 # moved from dirA/file1
dirB/x/ # normal directory
dirB/x/file2 # moved from dirA/x/file2
dirB/y/ # normal directory
dirB/y/file3 # moved from dirA/y/file3
The find /path/ -type f -size +300m
but then what? and unfortunately some of the files have all sorts of characters you can find on your keyboard.
I have been looking at this thread where someone is talking about cpio
but I don't know that program...
PS: have GNU Parallel installed if this could speed up things?
#!/bin/zsh
. I've fixed the bug in the second snippet, thanks. – Gilles 'SO- stop being evil' Nov 08 '16 at 21:14