More detailed usage of linux seq

Source: Internet
Author: User

In the past, I was worried about 01 11 when I was in for I. I checked a seq and found that there were other features.

The seq command is used to print a string of ordered numbers. It consists of the following three parameters:

-F,-format = FORMAT

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

-F: Specifies the print format:

For example:

[Root @ hao32] # seq-f % 05g 2 7

00002

00003

00004

00005

00006

00007

-S,-separator = STRING

Use STRING to separate numbers (default: \ n)

-S: the default Delimiter is carriage return:

For example:

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

2 3 4 5 6 7

-W,-equal-width

Equalize width by padding with leading zeroes

-W outputs are supplemented with "0" when the front of the same width is insufficient, that is, they are aligned with the maximum number of digits.

For example:

[Root @ hao32] # seq-w 2 11

02

03

04

05

06

07

08

09

10

11
 

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.