Linux fold command details how to use Linux fold command

Source: Internet
Author: User

The fold command reads the content from the specified file, adds the columns that exceed the specified column width to the column, and then outputs the content to the standard output device. If no file name is specified or the given file name is "-", The fold command reads data from the standard input device.

Syntax

Fold [-bs] [-w <number of lines per column>] [-- help] [-- version] [file...]

Parameters:

  • -B or -- bytes calculates the column width in bytes, rather than the number of rows.
  • -S or -- spaces use space characters as column points.
  • -W <number of rows per column> or -- width <number of rows per column> sets the maximum number of rows per column.
  • -- Help online help.
  • -- Version: displays the version information.

Instance

Fold the row of a file named testfile to 30 in width. Run the following command:

Fold-w 30 testfile

To compare, output the testfile file as follows:

$ Cat testfile # View content in testfile

Linux networks are becoming more and more common,

Security is often an overlooked

Issue. Unfortunately, in today's environment all networks

Are potential hacker targets,

From top-secret military research networks to small home LANs.

Linux Network Security focuses on securing Linux in

Networked environment, where

Security of the entire network needs to be considered

Rather than just isolated machines.

It uses a mix of theory and practical techniques

Teach administrators how to install and

Use security applications, as well as how

Applications work and why they are necessary.

Then use the fold command to fold the display:

$ Fold-w 30 testfile # The row is folded to 30 in width and the testfile file is displayed.

Linux networks are becoming mo

Re and more common, but securi

Ty is often an overlooked issu

E. Unfortunately, in today's

Environment all networks are

Potential hacker targets, from

Top-secret military research

Networks to small home LANs.

Linux Network Security focuses

On securing Linux in a networ

Ked environment, where the sec

Urity of the entire network ne

Eds to be considered rather th

An just isolated machines. It

Uses a mix of theory and pract

Ical techniques to teach admin

Istrators how to install and u

Se security applications, as w

Ell as how the applications wo

Rk and why they are necessary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.