Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1614068
  • 博文数量: 409
  • 博客积分: 6240
  • 博客等级: 准将
  • 技术积分: 4908
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-01 00:04
文章分类

全部博文(409)

文章存档

2021年(1)

2019年(1)

2017年(1)

2016年(13)

2015年(22)

2013年(4)

2012年(240)

2011年(127)

分类: LINUX

2011-07-27 10:09:53

[root@testcms kaige]# seq --help
Usage: seq [OPTION]... LAST
  or:  seq [OPTION]... FIRST LAST
  or:  seq [OPTION]... FIRST INCREMENT LAST
Print numbers from FIRST to LAST, in steps of INCREMENT.
  -f, --format=FORMAT      use printf style floating-point FORMAT (default: %g)
  -s, --separator=STRING   use STRING to separate numbers (default: \n)
  -w, --equal-width        equalize width by padding with leading zeroes
      --help     display this help and exit
 

seq命令的作用就是打印出一串有序的数字,它主要有以下3个参数构成:

       -f, --format=FORMAT 
              use printf style floating-point FORMAT (default: %g)

-f 指定打印的格式:
例如:
[root@hao32]# seq -f %05g 2 7 
00002
00003
00004
00005
00006
00007

       -s, --separator=STRING
              use STRING to separate numbers (default: \n)
-s 指定分隔符 默认是回车:
例如:
[root@hao32]# seq -s" " 2 7
2 3 4 5 6 7

       -w, --equal-width
              equalize width by padding with leading zeroes
-w 输出是同宽 前面不足的用 "0" 补全,即与位数最多的数对齐
例如:
[root@hao32]# seq -w 2 11
02
03
04
05
06
07
08
09
10
11


阅读(1085) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~