<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tool &#8211; Yuanle&#039;s Blog</title>
	<atom:link href="https://blog2.emacsos.com/tag/tool/feed" rel="self" type="application/rss+xml" />
	<link>https://blog2.emacsos.com</link>
	<description></description>
	<lastBuildDate>Mon, 05 May 2025 15:47:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog2.emacsos.com/wp-content/uploads/2025/05/favicon-150x150.png</url>
	<title>tool &#8211; Yuanle&#039;s Blog</title>
	<link>https://blog2.emacsos.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>The Units Tool in Linux</title>
		<link>https://blog2.emacsos.com/the-units-tool.html</link>
		
		<dc:creator><![CDATA[sylecn]]></dc:creator>
		<pubDate>Sun, 23 Oct 2016 10:14:00 +0000</pubDate>
				<category><![CDATA[Linux Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tool]]></category>
		<guid isPermaLink="false">https://blog2.emacsos.com/?p=59</guid>

					<description><![CDATA[GNU Units can be used for many things. It is such a useful tool that I always install it on all [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.gnu.org/software/units/">GNU Units</a> can be used for many things. It is such a useful tool that I always install it on all Linux nodes.</p>



<p>Here is how I use it:</p>



<p>Convert network speed. ISPs and network device use <em>bit per second</em>, downloaders usually use <em>byte per second</em>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 1000Mbps MiB/s
; 119.21 MiB/s
units 100Mbps MiB/s
; 11.92 MiB/s
units 20Mbps MiB/s
; 2.38 MiB/s
units 4Mbps KiB/s
; 488 KiB/s
</pre></div>


<p>Calculate average download speed</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 800MiB/25min KiB/s
; 546.1 KiB/s
</pre></div>


<p>Convert hard drive space. Operating systems show GiB/TiB, while vendors use GB/TB.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 1TB GiB
; 931.3 GiB
units 2TB GiB
; 1862.6 GiB
</pre></div>


<p>You can do calculation too. For example, if you have 24 16TB disks. Each data is stored in 3 replicas. At 80% capacity, you may store up to</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
units 16TB*24/3*0.8 TiB
; 93.13 TiB
</pre></div>


<p>Do time calculations</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units &#039;2 hour + 34 min + 1 day&#039;
; 95640 s
units &#039;2 hour + 34 min + 1 day&#039; hour
; 26.6 hour
units 8mo weeks
; 34.8 weeks
</pre></div>


<p>Convert between tps and maximum possible total request per day</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 132tps req/day
; 11404800 req/day
units 132tps million*req/day
; 11.4 million*req/day
</pre></div>


<p>Convert between (single node) tps and average response time</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 132tps ms/req
; 7.5 ms/req
</pre></div>


<p>Convert foreign currency to local currency</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
units 39.99hkd usd
; 5.1 usd

units 500hkd/mo usd/year
; 765 usd/year
</pre></div>


<p>You may have notice some units are not built-in. Units allow you to define your own units very easily. Here is my <code>~/.units</code> file:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
word    !
words   1 word

rmb     !
cny     rmb
RMB     rmb
hkd     0.9393 rmb
aud     4.6608 rmb
usd     7.2959 rmb
eur     8.266 rmb
euro    eur
gbp     9.7282 rmb
GBp     0.01gbp
jpy     0.050583 rmb
sgd     5.5781 rmb
s$      sgd
inr     0.081919 rmb
rs      inr
mvr     0.4637 rmb
laari   0.01 mvr

request !
req     request
r       request
tps     req/s

BTC     64219 usd
bitcoin 1 BTC
btc     BTC

ETH     3490 usd
Ether    1 ETH
Ethereum 1 ETH
eth      ETH

# units 0K tempC
# units 0K tempF

core    !

jin     0.5kg

char    !

share   !

w       10000
yi      100000000

tx      !
transaction   tx
trans   tx

kwh     1000*watt*hour

</pre></div>


<p>You can define basic unit by using &#8216;!&#8217;, you can define unit alias, you can define conversion. See&nbsp;<code>man units</code>&nbsp;for more information.</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
