I am looking for a bash or sed script (preferably a one-liner) with which I can insert a new line character after a fixed number of characters in huge text file.
Because I can't comment directly (to less reputations) a new hint to upper comments:
I prefer the sed command (exactly what I want) and also tested the Posix-Command fold. But there is a little difference between both commands for the original problem: If you have a flat file with n*bytes records (without any linefeed characters) and use the sed command (with bytes as number (20 in the answer of @Kristian)) you got n lines if you count with wc. If you use the fold command you only got n-1 lines with wc! This difference is sometimes important to know, if your input file doesn't contain any newline character, you got one after the last line with sed and got no one with fold