Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of the Linux basic command fold

Shulou Source: shulou.com Published: 2022-06-01 12:38:42 11月03日 Update

This article introduces the relevant knowledge of "the usage of the Linux basic command fold". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Fold

Displays the file at the specified width. The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Fold [options] file

2. List of options

Option

Description

-- help

Show help documentation

-- version

Display version information

-b |-- bytes

Specifies the width in bytes

-c |-- characters

Specifies the width in characters

-s |-- space

Divide by SPAC

-w |-- width

Specify column width, default is 30

3. Examples

Output every 6 bytes on one line

[root@localhost weijie] # cat 1.c

Hello world, i am david. I love linux, love code.

[root@localhost weijie] # fold-b6 1.c

Hello

World

I am

David.

I lov

E linu

X, lov

E code

This is the end of the introduction to "the usage of the Linux basic command fold". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Command width base content unit byte more knowledge output utility learning and then one line information dilemma character instance actual situation file Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux vpn MySQL Redmi