fold file.txt
# fold command in Linux wraps each line in an input file to fit a specified width# and prints it to the standard output. By default, it wraps lines at a maximum wi# dth of 80 columns but this is configurable. To fold input using the fold command# pass a file or standard input to the command.
使用fold命令进行分隔,指定每行最多包含默认值50个字符。
fold -w 50 file.txt
# fold command in Linux wraps each line in an input# file to fit a specified width and prints it to the# standard output. By default, it wraps lines at a# maximum width of 80 columns but this is configurab# le. To fold input using the fold command pass a fi# le or standard input to the command.
使用fold命令进行分隔,并使用-s选项用于分隔空格上的行,以便不打断单词。
fold -w 50 -s file.txt
# fold command in Linux wraps each line in an input# file to fit a specified width and prints it to# the standard output. By default, it wraps lines# at a maximum width of 80 columns but this is# configurable. To fold input using the fold# command pass a file or standard input to the# command.