SPLIT(1plan9)

🌸 SPLIT(1plan9) 🌸

okay bestie, welcome to the Plan 9 manual, section 1, and today's main character is split πŸ’… she's been in the Plan 9 manual forever and she's still serving.


✨ NAME ✨

split β€” literally just chop a file into lil pieces πŸ“


πŸŽ€ SYNOPSIS πŸŽ€

split [ option ...  ] [ file ]

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: split reads file (or standard input if you don't give it a file, she's flexible like that πŸ¦‹) and writes it back out in pieces of 1000 lines per output file. iconic behavior honestly.

the output file names go xaa, xab, and so on all the way to xzz ✨ β€” yes bestie, that's the whole alphabet rotation, she's got range.

the options are:

  • -n n β€” split into n-line pieces. that's it, that's the whole thing πŸ’…
  • -l n β€” a synonym for -n n, a lil nod to Unix's syntax 🫢 (she said "I see you, Unix")
  • -e expression β€” file divisions occur at each line that matches a regular expression; see regexp(7). multiple -e options may appear, stack 'em up. and β€” this is the fun part β€” if a subexpression of expression is contained in parentheses (...), the output file name is the portion of the line which matches the subexpression. so the file basically names itself?? main character energy fr fr πŸ‘‘
  • -f stem β€” use stem instead of x in output file names. you're customizing the prefix, do your thing πŸ’–
  • -s suffix β€” append suffix to names identified under -e. little finishing touch ✨
  • -x β€” exclude the matched input line from the output file. she's leaving that line on read πŸ’€
  • -i β€” ignore case in option -e; and force output file names (excluding the suffix) to lower case. two-for-one, she ate πŸ”₯

🌈 SOURCE 🌈

/src/cmd/split.c


πŸ¦‹ SEE ALSO πŸ¦‹

sed(1), awk(1), grep(1), regexp(7)


πŸ’œ okay that's the whole page, no cap. every flag, every default, every file name range β€” all accounted for. go split something, bestie 🧚

and yes, the footer says SPLIT(1plan9) again, which is very much her walking in, saying her own name, and walking out πŸ’…βœ¨

πŸ“¦ where this page comes from