<p>On Linux, you can use the <code>file</code> command. If the file is a Bitcoin wallet, you should see</p>

<pre><code>wallet.dat: Berkeley DB (Btree, version 9, native byte-order)
</code></pre>

<p>(It will always say Berkley DB version 9, but the filename might be different.)</p>

<p><code>file</code> is also availible on Windows: <a href="http://gnuwin32.sourceforge.net/packages/file.htm" rel="nofollow noreferrer">http://gnuwin32.sourceforge.net/packages/file.htm</a></p>

<p>How does <code>file</code> tell that it's a Berkley DB file? See <a href="https://unix.stackexchange.com/questions/244502/how-did-file-identify-this-particular-file">How did file identify this wallet file?</a></p>

CC BY-SA 3.0
2017-05-28T04:04:28.660Z
Installing Linux just a sec...
marshal craft
CC BY-SA 3.0
2017-05-29T00:05:47.687Z
@marshalcraft actually I *am* using a Linux computer, I forgot to mention, edited question now.
adrianTNT
CC BY-SA 3.0
2017-05-28T02:50:24.277Z
2017-05-28T02:50:24.277Z
Nick ODell
<p>If I have many files on my hard drive (possibly with different names/extension), how can I test which file is a valid bitcoin wallet.dat ? </p>

<p>Maybe there is some string that exists in every bitcoin wallet ? </p>

<p>I guess I am asking about the format of the data inside the wallet. 
If wallets are different depending on the bitcoin client, then I want to know about bitcoin core.</p>

<p><strong>Edit:</strong> I forgot to mention but these files WERE on a Linux OS. So there should be some solutions.</p>

<bitcoin-core><wallet><wallet.dat><bitcoin-core-development><e-wallet>
How to know a given file is a valid bitcoin wallet?
adrianTNT
# How to know a given file is a valid bitcoin wallet?

(Asked by: username_0 on 2017-05-28)

If I have many files on my hard drive (possibly with different names/extension), how can I test which file is a valid bitcoin wallet.dat ?

Maybe there is some string that exists in every bitcoin wallet ?

I guess I am asking about the format of the data inside the wallet.
If wallets are different depending on the bitcoin client, then I want to know about bitcoin core.

**Edit:** I forgot to mention but these files WERE on a Linux OS. So there should be some solutions.

**Tags:** bitcoin-core, wallet, wallet.dat, bitcoin-core-development, e-wallet


---

## 1 answers

### Answer by username_1 on 2017-05-28. Score: 1 | Accepted answer

On Linux, you can use the file command. If the file is a Bitcoin wallet, you should see
wallet.dat: Berkeley DB (Btree, version 9, native byte-order)

(It will always say Berkley DB version 9, but the filename might be different.)
file is also availible on Windows: http://gnuwin32.sourceforge.net/packages/file.htm
How does file tell that it's a Berkley DB file? See How did file identify this wallet file?

> **Comments:**
> **username_2**: Installing Linux just a sec...  
> **username_0**: @marshalcraft actually I *am* using a Linux computer, I forgot to mention, edited question now.  

---

