<p>As @Raghav Sood mentioned, you can stop bitcoin for a different datadir (the location of <code>.bitcoin</code> folder) using:</p>

<p><code>$ bitcoin-cli -datadir=&lt;dir&gt; stop</code></p>

CC BY-SA 4.0
2018-08-23T14:00:56.810Z
2018-08-23T14:00:56.810Z
JBaczuk
<p>I tried stopping bitcoind using bitcoin-cli stop and got the following error.</p>

<pre><code>bitcoin-cli stop
error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/user/.bitcoin/bitcoin.conf)
</code></pre>

<p>I confirmed that bitcoind is running (using ps -A). </p>

<pre><code>ps -A | grep bitcoind
643 pts/0    00:17:23 bitcoind
</code></pre>

<p>bitcoind was started in a datadir on the usb storage. I can kill the process but i want to shut it down in a correct way.</p>

CC BY-SA 4.0
2018-08-23T05:45:35.623Z
Try pointing `bitcoin-cli` to the same datadir
Raghav Sood
<bitcoind><bitcoin-cli><datadir>
bitcoin-cli not stopping bitcoind
noi.m
# bitcoin-cli not stopping bitcoind

(Asked by: username_0 on 2018-08-23)

I tried stopping bitcoind using bitcoin-cli stop and got the following error.
bitcoin-cli stop
error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/user/.bitcoin/bitcoin.conf)

I confirmed that bitcoind is running (using ps -A). 
ps -A | grep bitcoind
643 pts/0    00:17:23 bitcoind

bitcoind was started in a datadir on the usb storage. I can kill the process but i want to shut it down in a correct way.

**Tags:** bitcoind, bitcoin-cli, datadir

> **Comments:**
> **username_1**: Try pointing `bitcoin-cli` to the same datadir  

---

## 1 answers

### Answer by username_2 on 2018-08-23. Score: 1 | Accepted answer

As @username_1 mentioned, you can stop bitcoin for a different datadir (the location of `.bitcoin` folder) using:

`$ bitcoin-cli -datadir= stop`


---

