Split a file every 5 lines, ignoring exact-division error

csplit

  • Split a file into pieces.
    This generates files named "xx00", "xx01", and so on.
    More information: <https://www.gnu.org/software/coreutils/csplit>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

csplit -k {{file}} {{5}} {*}

click the source code to copy install csplit on any operating system with command-not-found.com