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) ...
随机推荐
- 修复 status 为 unusable 的 index
以DBA权限登陆,执行以下脚本即可. declare -- 指向所有 UNUSABLE 状态的 index 的游标 cursor c is select index_n ...
- php遍历数据库
数据库 <?php mysql_connect("localhost","root",""); mysql_set_charset(& ...
- 转自:http://blog.sina.com.cn/s/blog_86e874d30101e3d8.html(谢谢原文作者),Win7下安装CentOS 6.5双系统
经过一下午的折腾,终于在64位的Windows 7上面成功安装了CentOS 6.5(64bit)系统,中途因为硬盘分区的问题失败了一次.下面是安装过程: 在安装过程中借助了这篇文章的内容:http: ...
- storm之8:并行度
(一)storm拓扑的并行度可以从以下4个维度进行设置:1.node(服务器):指一个storm集群中的supervisor服务器数量.2.worker(jvm进程):指整个拓扑中worker进程的总 ...
- ECSTORE2.0 定时任务配置
今天在配置ecstore2.0的定时任务时候,发现ECOS后台每30秒通过JS调用 http://localhost/ecstore-bugfix/index.php/shopadmin/index. ...
- Hibernate对象的状态和映射
一. Hibernate对象的状态 实体对象的三种状态: 1) 暂态(瞬时态)(Transient)---实体在内存中的自由存在,它与数据库的记录无关. po在DB中无记录(无副本),po和sessi ...
- android EditText内嵌图片
如下所示: 主要用到的属性:android:drawableLeft <EditText android:layout_width="match_parent" androi ...
- 在Linux上配置vsftpd
一般安装好vsftpd这个服务,它的默认配置文件在这里:/etc/vsftpd/vsftpd.conf 用vim在里面可以添加一些变量控制权限之类的.还有很多chroot相关的东西,里面的变量都有作用 ...
- U-Boot启动过程完全分析
U-Boot启动过程完全分析 1.1 U-Boot工作过程 U-Boot启动内核的过程可以分为两个阶段,两个阶段的功能如下: (1)第一阶段的功能 硬件设备初始化 加载U-Boot第二阶段 ...
- Linux企业级项目实践之网络爬虫(27)——多路IO复用
与多线程和多进程相比,I/O多路复用的最大优势是系统开销小,系统不需要建立新的进程或者线程,也不必维护这些线程和进程. 主要应用: (1)客户程序需要同时处理交互式的输入和服务器之间的网络连接 (2) ...