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

What is the use of the seq command in Linux

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of the seq command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The Linux common command seq command is used to generate all integers from one number to another.

Seq prints numbers from the first to the Mantissa in specified increments

Syntax seq [options]... Mantissa seq [option]... The first and last seq [option]. The first increment Mantissa option-f,-- format= format uses the printf-style floating-point format-s,-- separator= string uses the specified string to separate numbers (default:\ n)-w,-- equal-width adds 0 before the column to make the width the same instance-f option: specify format

# seq-f the number of digits specified after "% 3G" 9 11 9 10 11% defaults to% gjournal% 3G, then the number of digits below is a space.

# sed-f "g" 9 11 # seq-f "strg" 9 11 str009 str010 str011 if the number of digits is insufficient, the number of digits is 0% before setting the string.

-w option: specifies that the output number is the same width

Seq-w 98 101 098 099 100 101 cannot be used with-f, the output is the same width.

-s option: specify the delimiter (enter by default)

Seq-s ""-f "strg" 9 11 str009 str010 str011 to specify / t as the separator:

Seq-s "`echo-e" / t "`" 9 11 specifies\ nas the separator:

Seq-s "`echo-e"\ n "`" 911 19293949596979899910911 is an error, but it is generally not necessary. It defaults to enter as the delimiter.

Thank you for reading this article carefully. I hope the article "what is the use of seq commands in Linux" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Development

Wechat

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

12
Report