Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use seq in linux

Shulou Source: shulou.com Published: 2022-05-31 22:13:15 09月23日 Update

Editor to share with you how to use seq in linux. I hope you will get something after reading this article. Let's discuss it together.

In the past, I made for i in worry about 01 / 11, but I checked a handful of seq and found that there were other features.

The function of the seq command is to print out an ordered series of numbers, which are mainly composed of the following three parameters:

-f.-format=FORMAT.

Use printf style floating-point FORMAT (default:% g)

-f specifies the format of the print:

For example:

[root@hao32] # seq-f g 2 7

00002

00003

00004

00005

00006

00007

-s.-separator=STRING.

Use STRING to separate numbers (default:\ n)

-s specifies that the delimiter defaults to enter:

For example:

[root@hao32] # seq-s "" 2 7

2 3 4 5 6 7

-w.-equal-width.

Equalize width by padding with leading zeroes

The-w output is completed with "0" which is insufficient in front of the same width, that is, it is aligned with the number with the largest number of digits.

For example:

[root@hao32] # seq-w 2 11

02

03

04

05

06

07

08

09

ten

eleven

After reading this article, I believe you have a certain understanding of "how to use seq in linux". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Articles order annoyance digits functions delimiters parameters commands done that is numbers times more formats features knowledge industry information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Apple Microsoft Redmi