seq命令

作用:

输出固定格式的要求

 

选项:

-s  指定输出的分隔符 默认为\n

-w  指定为定宽输出,不能和-f一起用

-f   按照指定格式输出,不能和-w一起用

[root@localhost] ~/testdown$ seq 1 5
1
2
3
4
5
[root@localhost] ~/testdown$ seq 1 2 10
1
3
5
7
9
[root@localhost] ~/testdown$ seq -s : 1 2 10
1:3:5:7:9
[root@localhost] ~/testdown$ seq -w 8 11
08
09
10
11
[root@localhost] ~/testdown$ seq -f 'dir%04g' 8 11
dir0008
dir0009
dir0010
dir0011
[root@localhost] ~/testdown$ mkdir $(seq -f 'dir%03g' 1 3)
[root@localhost] ~/testdown$ ls
dir001  dir002  dir003

 

posted @ 2018-02-24 17:31  fanren224  阅读(117)  评论(0编辑  收藏  举报