[Bash] fold command

Sometimes it's handy to break long lines into shorter lines.

# read moby-dick file for first 250 lines
# then fold each line to have max 30 char (-w)
# -s make sure we don't break words
head -250 moby-dick.txt | fold -sw 30
posted @ 2024-05-30 17:49  Zhentiw  阅读(2)  评论(0编辑  收藏  举报