<p>you can do it by using <strong>blockchain.info</strong> and common bash tools that you already have in your system like <strong>wget</strong>, <strong>grep</strong> and <strong>awk</strong>, <strong>printf</strong> for formatting</p>

<p>For example by using (replace <em>ADDRESS</em> with the actual address you want to query):</p>

<pre><code>wget -qO- blockchain.info/rawaddr/ADDRESS 2&gt;&amp;1 | grep -Po '"final_balance":\K[0-9]+'
</code></pre>

<p>And if you want to format the output from satoshi to btc you can use:</p>

<pre><code>wget -qO- blockchain.info/rawaddr/ADDRESS 2&gt;&amp;1 | grep -Po '"final_balance":\K[0-9]+' | awk '{s=$1/100000000} END {printf "%0.8f\n", s}'
</code></pre>

CC BY-SA 3.0
2017-08-30T14:44:15.137Z
2017-08-30T14:44:15.137Z
D.Snap
<p>I need to get the balance of specifics wallets <em>only</em> by using bash terminal tools <em>without</em> installing anything new to the OS (An old customized Ubuntu Server)</p>

<p>Any idea how to do it? Thanks in advance.</p>

<blockchain><wallet><bash>
How to get the balance of a wallet using only bash interface?
Diego Diaz Valdez
# How to get the balance of a wallet using only bash interface?

(Asked by: username_0 on 2017-08-30)

I need to get the balance of specifics wallets *only* by using bash terminal tools *without* installing anything new to the OS (An old customized Ubuntu Server)

Any idea how to do it? Thanks in advance.

**Tags:** blockchain, wallet, bash


---

## 1 answers

### Answer by username_1 on 2017-08-30. Score: 4 | Accepted answer

you can do it by using blockchain.info and common bash tools that you already have in your system like wget, grep and awk, printf for formatting
For example by using (replace ADDRESS with the actual address you want to query):
wget -qO- blockchain.info/rawaddr/ADDRESS 2>&1 | grep -Po '"final_balance":\K[0-9]+'

And if you want to format the output from satoshi to btc you can use:
wget -qO- blockchain.info/rawaddr/ADDRESS 2>&1 | grep -Po '"final_balance":\K[0-9]+' | awk '{s=$1/100000000} END {printf "%0.8f\n", s}'


---

