Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use seq in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report