Linux under SEQ command

Source: Internet
Author: User

SEQ command: Used to produce an integer that counts to another number

Example 1:

[[email protected] 0702]# SEQ 1 5

1

2

3

4

5

[[email protected] 0702]# SEQ 5

1

2

3

4

5

The result of SEQ 1 5 and SEQ 5 is the same, and the default starting value is set from 1.


Example 2: Generating a set of integers between 7 and 30 with an interval of 3

[[email protected] 0702]# SEQ 7 3 30

7

10

13

16

19

22

25

28


Example 3:

-W output is the same width, less than 0 fill

[Email protected] 0702]# SEQ-W 8 13

08

09

10

11

12

13


Example 4:

-f Specifies the output format

[[email protected] 0702]# seq-f "str%03g" 8 13

str008

str009

str010

str011

str012

str013

% preceded by the specified string str,% the number of additions and digits, with a "0" supplement (the default is a space) is 3 bits


Example 5:

-s Specifies that the delimiter is carriage return by default

[[email protected] 0702]# seq-s ""-F "str%03g" 8 13

str008 str009 str010 str011 str012 str013

Use tabs to make delimiters

[[email protected] 0702]# seq-s "' Echo-e" \ T "'" 8 13

8913



This article is from the "Fish" blog, so be sure to keep this source http://pastfish.blog.51cto.com/3585387/1433775

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.