linux命令之seq
seq命令简述
基本用法
thatsit:~ # seq 1 20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
thatsit:~ #
thatsit:~ # seq -s " " 1 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
thatsit:~ #
# 使用等宽参数
thatsit:~ # seq -w -s " " 1 20
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
thatsit:~ #
高级用法
thatsit:~ # printf '%g ' `seq 1 20`
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
thatsit:~ #
八进制:
thatsit:~ # printf '%o ' `seq 1 20`
1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22 23 24
thatsit:~ #
十六进制:
thatsit:~ # printf '%x ' `seq 1 20`
1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14
thatsit:~ #
两位数精度的浮点数:
thatsit:~ # printf '%.2f ' `seq 1 20`
1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00
thatsit:~ #
四位数精度的浮点数:
thatsit:~ # printf '%.4f ' `seq 1 20`
1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000
thatsit:~ #
others
此外还有一些科学计数法等格式,一般用不到,了解下即可:
linux命令之seq的更多相关文章
- Linux命令之乐--seq
用法及参数: -f, --format=格式 使用printf 样式的浮点格式,默认是g% -s, --separator=字符串 使用指定字符串分隔数字(默认使用:\n) - ...
- Linux常用命令之seq
标题:seq命令的使用 作用:seq命令用于以指定增量从首数开始打印数字到尾数,即产生从某个数到另外一个数之间的所有整数,并且可以对整数的格式.宽度.分割符号进行控制 语法: [1] seq [选项] ...
- Linux命令随笔
Linux命令总结 man ==命令帮助; help ==命令的帮助(bash的内置命令); ls ==list,查看目录列表; -ld:查看目录权限; -l:(long)长格式显示属性; -F:给不 ...
- Linux 命令小记
1. pidof 进程名 :获取进程的pid,例如 pidof memcached 得到5333 2. unset Shell变量 :取消设置一个shell变量,从内存和shell的导出环境中删除它, ...
- [Android ] linux命令英文缩写的含义(方便记忆)
du -sh */ reference to : http://blog.chinaunix.net/uid-27164517-id-3299073.html linux常用命令的英文单词缩写 命令缩 ...
- Linux命令行技巧
Linux命令行技巧 命令 描述 • apropos whatis 显示和word相关的命令. 参见线程安全 • man -t man | ps2pdf - > man.pdf 生成一个PDF格 ...
- 我使用过的Linux命令
我使用过的Linux命令之tee - 重定向输出到多个文件 用途说明 在执行Linux命令时,我们可以把输出重定向到文件中,比如 ls >a.txt,这时我们就不能看到输出了,如果我们既想把输出 ...
- linux命令英文缩写的含义(方便记忆)
命令缩写: ls:list(列出目录内容) cd:Change Directory(改变目录) su:switch user 切换用户 rpm:redhat package manager 红帽子打包 ...
- 1、Linux命令随笔
1 Linux命令总结 2 3 man ==命令帮助; 4 help ==命令的帮助(bash的内置命令); 5 ls ==list,查看目录列表; 6 -ld:查看目录权限; 7 -l:(long) ...
随机推荐
- 在浏览器中打不开Oracle 11gR2的企业管理器页面
最简单的办法,重建EM 四个步骤: emca -repos drop emca -repos create emca -config dbcontrol db emctl start dbconsol ...
- MySQL FROM 子查询
FROM 子句中的子查询 MySQL FROM 子查询是指 FROM 的子句作为子查询语句,主查询再到子查询结果中获取需要的数据.FROM 子查询语法如下: SELECT ... FROM (subq ...
- The partial sum problem
算法:搜索 描述 One day,Tom's girlfriend give him an array A which contains N integers and asked him:Can yo ...
- linux定时任务crond那些事!
1.定时任务crond介绍 1.1 crond是什么 crond是linux系统中用来定期执行命令或指定程序任务的一种服务或软件. 特殊需求:(秒级别)crond服务就无法搞定了,一般工作中写脚本守护 ...
- python之scrapy入门教程
看这篇文章的人,我假设你们都已经学会了python(派森),然后下面的知识都是python的扩展(框架). 在这篇入门教程中,我们假定你已经安装了Scrapy.如果你还没有安装,那么请参考安装指南. ...
- Jasper_filter data_pass field data from main to sub to filter some data
main report: 1 add variable <variable name="Variable_rule" class="java.lang.String ...
- Xtrabackup 对MYSQL进行备份还原
在操作MYSQL中注意两个概念: 干什么都记得 flush privileges; grant all on *.* to root@'localhost' identified by 'passwo ...
- POJ 3009 深度优先搜索
问题:打冰球.冰球可以往上下左右4个方向走,只有当冰球撞到墙时才会停下来,而墙会消失.当冰球紧贴墙时,不能将冰球往那个方向打.冰球出界就当输,超过10次还没将冰球打到目标位置也当输.求用最小次数将冰球 ...
- mysql优化整理(索引)
什么是索引? 索引是表记录的单个或多个字段重新组织的一种方法,其目的是提高数据库的查询速度,本质上就是一种数据结构. 索引的类型:primary(主键).secondary(其他) 索引的数据结构 I ...
- mybatis dao无实现类的配置
spring的配置文件 添加: <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> ...