Skip to content

Instantly share code, notes, and snippets.

@sephraim
Created March 31, 2015 17:52
Show Gist options
  • Save sephraim/b76b8383282321353e3c to your computer and use it in GitHub Desktop.
Save sephraim/b76b8383282321353e3c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Split a file into N parts
#
# Each resulting file will have a .ptXX suffix
#
# Example - split file into 30 parts:
# ./parts.sh myfile.txt 30
split -dl$((`wc -l < $1`/$2+1)) $1 $1.pt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment