How to specify an output directory for split(1)
Submitted by Bram Schoenmakers on 8 March, 2008 - 18:09.
I had to transfer a big file to some remote site, and have it split up there. So something like:
cat some_big_file | ssh bram@example.com split
However, the split(1) utility does not have a command line option to specify an output directory. It only puts files in the current working directory, which is undesired in this case. But /bin/sh to the rescue, it is possible:
cat some_big_file | ssh bram@example.com 'sh -c "cd /remote/dest/dir; split"'