linux numfmt 命令--转换数字
numfmt
SYNOPSIS
numfmt [OPTION]... [NUMBER]...
DESCRIPTION
Reformat NUMBER(s), or the numbers from standard input if none are
specified. Mandatory arguments to long options are mandatory for short options
too. --debug
print warnings about invalid input -d, --delimiter=X
use X instead of whitespace for field delimiter --field=N
replace the number in input field N (default is 1) --format=FORMAT
use printf style floating-point FORMAT; see FORMAT below for
details --from=UNIT
auto-scale input numbers to UNITs; default is 'none'; see UNIT
below --from-unit=N
specify the input unit size (instead of the default 1) --grouping
use locale-defined grouping of digits, e.g. 1,000,000 (which
means it has no effect in the C/POSIX locale) --header[=N]
print (without converting) the first N header lines; N defaults
to 1 if not specified --invalid=MODE
failure mode for invalid numbers: MODE can be: abort (default),
fail, warn, ignore --padding=N
pad the output to N characters; positive N will right-align;
negative N will left-align; padding is ignored if the output is
wider than N; the default is to automatically pad if a whites-
pace is found --round=METHOD
use METHOD for rounding when scaling; METHOD can be: up, down,
from-zero (default), towards-zero, nearest UNIT options:
none no auto-scaling is done; suffixes will trigger an error auto accept optional single/two letter suffix: 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, si accept optional single letter suffix: 1K = 1000, 1M = 1000000, ... iec accept optional single letter suffix: 1K = 1024, 1M = 1048576, ... iec-i accept optional two-letter suffix: 1Ki = 1024, 1Mi = 1048576, ... FORMAT must be suitable for printing one floating-point argument '%f'.
Optional quote (%'f) will enable --grouping (if supported by current
locale). Optional width value (%10f) will pad output. Optional nega-
tive width values (%-10f) will left-pad output. Exit status is 0 if all input numbers were successfully converted. By
default, numfmt will stop at the first conversion error with exit sta-
tus 2. With --invalid='fail' a warning is printed for each conversion
error and the exit status is 2. With --invalid='warn' each conversion
error is diagnosed, but the exit status is 0. With --invalid='ignore'
conversion errors are not diagnosed and the exit status is 0.
EXAMPLES
$ numfmt --to=si 1000
-> "1.0K"
$ numfmt --to=iec 2048
-> "2.0K"
$ numfmt --to=iec-i 4096
-> "4.0Ki"
$ echo 1K | numfmt --from=si
-> "1000"
$ echo 1K | numfmt --from=iec
-> "1024"
GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
linux numfmt 命令--转换数字的更多相关文章
- Linux Free命令各数字含义及Buffer和Cache的区别
Linux Free命令各数字含义及Buffer和Cache的区别 Free 命令的各数字含义 命令演示 [root@vm1 ~]# free total used free shared buffe ...
- Linux Free命令每个数字的含义 和 cache 、buffer的区别
Linux Free命令每个数字的含义 和 cache .buffer的区别 我们按照图中来一细细研读(数字编号和图对应)1,total:物理内存实际总量2,used:这块千万注意,这里可不是实际已经 ...
- linux tr命令实现windows文本格式与linux文本格式间的转换
tr 命令 转换和删除字符 选项: -d --delete:删除字符 -s --squeeze-repeats:把连续重复的字符以一个字符表示,即去重 -c –C --complement:取字符集的 ...
- Linux查找命令:grep,awk,sed
grep grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具 ...
- linux 常用命令大全
linux 常用命令大全 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统 ...
- linux全部命令
linux全部命令 一.安装和登陆命令1.进入图形界面startx 2.进入图形界面init 5 3.进入字符界面init 3 4.登陆login 5.关机poweroff-p 关闭机器的时候关闭电源 ...
- linux grep命令总结
风生水起善战者,求之于势,不责于人,故能择人而任势. 博客园 首页 新随笔 联系 订阅 管理 posts - 791, comments - 394, trackba ...
- Linux find命令详解
转自Linux find命令详解 一.find 命令格式 1.find命令的一般形式为: find pathname -options [-print -exec -ok ...] 2.find命令的 ...
- linux dd命令参数及用法详解---用指定大小的块拷贝一个文件(也可整盘备份)
linux dd命令参数及用法详解---用指定大小的块拷贝一个文件 日期:2010-06-14 点击:3830 来源: 未知 分享至: linux dd命令使用详解 dd 的主要 ...
随机推荐
- vs出现“已经在解决方案中打开了具有该名称的项目”问题的解决方案
经过本人测试,这种问题一般出现在装了svn的项目. 其实删除了删除sln和csproj文件中的SVN配置信息就行了 需要删除的信息 sln文件中: GlobalSection(SubversionSc ...
- js 事件处理程序 事件对象
事件:用户或浏览器自身执行的动作: 事件处理程序:响应某个事件的函数: 事件流:从页面中接收事件的顺序. 1.DOM事件流 "DOM2级事件"规定的事件流包括三个阶段:事件捕获阶段 ...
- C#复习⑥
C#复习⑥ 2016年6月19日 23:46 Main Interfaces & Delegates 接口和委托 1.接口基本语法 public interface IList : IColl ...
- Strange Problem O(∩_∩)O~
题目描述: 古代某个狱卒某天闲着没事想和两个罪犯玩个游戏,他找了个国际象棋盘,每个格子放上一个硬币,硬币长得都一样,正反都是狱卒自己决定. 之后他只让A罪犯观看棋盘,并随便指一个硬币告诉A罪犯,只要B ...
- Eclipse--Web项目中 .classpath、mymetadata、project文件的功用
Web项目中 .classpath..mymetadata..project文件的作用 创建Web Project时,会自动生成这个三个文件. 一..mymetadata文件 1.部署项目用的,把项目 ...
- 导入导出oracle数据库表的dmp文件
1.先进入命令行,点击开始,输入cmd 2.导入的命令是:imp 用户名/密码@网络服务名 file=xxx.dmp full=y; 3.导出的命令是:exp 用户名/密码@网络服务名 file=xx ...
- Lazy<T>在Entity Framework中的性能优化实践(附源码)
在使用EF的过程中,导航属性的lazy load机制,能够减少对数据库的不必要的访问.只有当你使用到导航属性的时候,才会访问数据库.但是这个只是对于单个实体而言,而不适用于显示列表数据的情况. 这篇文 ...
- ResultSet rs = stmt.executeQuery(sql); 返回值问题判断
JAVA ResultSet rs = stmt.executeQuery(sql); //查询返回的结果集不管是否查到,rs都不是null,那么问题是怎么判断查找不到来执行一个提示“账号或者 ...
- HashMap和HashSet
Java使用Set接口来描述集合,而Set中每一个数据元素都是唯一的. HashSet散列集合 Hash算法:把任意长度输入,通过散列算法,变换成固定长度的输出即散列值.对不同类型信息,散列值公式也是 ...
- js实现打开网页自动弹出添加QQ好友邀请窗口
我们有时进一些网面或专题页面会自动弹出一个加为好友的对话框了,在研究了很久之后发现可以直接使用js来实现,下面我们一起来看js实现打开网页自动弹出添加QQ好友邀请窗口的方法. 第一步.JS脚本 这个是 ...