1

How to merge chunks of text files in a directory to one or more files?

view story
linux-howto

http://unix.stackexchange.com – I have a requirement to merge chunks of text files in a directory to one or more files and then zip the merged file. For ex: If i have half a million text files in a directory, say A. I want to merge sets of 50,000 files into 1 i.e. I will have 10 merged files each having the content of 50,000 files. Finally, I want to zip each merged file, i.e. there will be totally 10 zip files at the end of this process. I tried doing this in shell script. I am unable to find a solution. Can someone let me know the most efficient way to achieve this using a shell script? (HowTos)