I have a bunch of huge files (4GB+ each) with the same extension in a directory structure in a network drive, but am only interested in the first few bytes of each, so I'd like to copy them all to my local drive, with the same filenames and maintaining the same folder structure.
I've tried:
$ find . -type d -exec mkdir -p ~/Desktop/heads/{} \;
$ find . -type f -name "*.ext" -exec head -c 128 {} > ~/Desktop/heads/{} \;
But it doesn't work, since they are all put in a file called '{}', probably because the '>' operator is not being interpreted as part of the -exec argument, and if I escape it with '\>', then it is escaped down to the head argument, which doesn't work either.