How can I make Bitcoin start with a simple `bitcoind` in the terminal?

1

1

When I want to start Bitcoin I have to use /opt/bitcoin/bin/bitcoind to start it. How can I use simply bitcoind to start it?

I am using centOS 7.

Jan Wytze

Posted 2016-02-12T14:15:10.037

Reputation: 289

1

related: http://stackoverflow.com/q/19720475/1364089

Murch 2016-02-12T14:35:17.813

Answers

1

The answer above is correct but doesn't explain anything to the user as to why they can't just type bitcoind in the first place. This doesn't help people at all and future people will just follow this blindly.

To understand why some commands can be typed in without the full path you must understand the $PATH environment variable. A very good writeup on it was done here http://www.linfo.org/path_env_var.html.

A short explination is that $PATH lets you define what paths on your computer are searched for executable files. You can see what the current searched paths are by typing echo $PATH into your terminal. Here is an example from mine.

echo $PATH
/Users/mschuett/Uber/phacility/arcanist/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mschuett/bin:/usr/local/bin

Each directory is separated by a : and if a path at /Users/mschuett/bin and /usr/local/bin both included a binary called test-command it would always use the test command found in /Users/mschuett/bin since it comes first in the $PATH string. To add more directories to your $PATH you can simply write..

export $PATH=$PATH:/opt/bitcoin/bin

Now all executables at this path are available without typing the full path. To see what path an executable is being run from you can use which bitcoind and it will output the full path that is used when you run bitcoind.

Hope this helps actually explain what is going on.

mschuett

Posted 2016-02-12T14:15:10.037

Reputation: 384

0

The solution is: sudo ln -s /opt/bitcoin/bin/* /bin

I found the answer at https://stackoverflow.com/q/19720475/1364089

Thanks to https://bitcoin.stackexchange.com/users/5406/murch

Jan Wytze

Posted 2016-02-12T14:15:10.037

Reputation: 289

Then don't just link it here, rather put your solution here and additionally link it! :)Murch 2016-02-12T15:45:01.217

you could also add /opt/bitcoin/bin to your $PATHMark S. 2016-03-13T19:12:29.507

This is not useful as it doesn't show why this works and it also shows that you have a fundamental misunderstanding of how your OS works. I have written up a better explanation below.mschuett 2016-03-13T20:16:29.140