Skip to main content Link Search Menu Expand Document (external link)

Bonus guide: Pimp the command line

Difficulty: Easy

Status: Tested v3


Table of contents

  1. Command prompt
  2. Bash completion

Command prompt

You can prettify your command prompt for each user by enabling color output and setting a custom prompt.

  • Open and edit .bashrc as shown below, save and exit
    $ nano /home/admin/.bashrc
    
# enable color prompt (uncomment, if commented out)
force_color_prompt=yes

# pimp prompt (comment/replace the PS1 line)
PS1="${debian_chroot:+($debian_chroot)}\[\e[33m\]\u \[\033[01;34m\]\w\[\e[33;40m\]\[\e[m\] "

# set "ls" to always use the -la option, to list details of all files (including hidden), as default
# simply insert the following line at the end of the file, or replace existing "alias ls='ls --color=auto'" if already present in the "enable color support of ls" section
alias ls='ls -la --color=always'

Pimp prompt

  • Reload configuration
    $ source /home/admin/.bashrc
    

Pimped prompt

Bash completion

As user “admin”, install bash completion scripts for Bitcoin Core and all Lightning projects. You then can complete partial commands by pressing the Tab key (e.g. bitcoin-cli getblockch [Tab] → bitcoin-cli getblockchaininfo )

$ cd /tmp/
$ wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/bitcoin-cli.bash-completion
$ wget https://raw.githubusercontent.com/lightningnetwork/lnd/master/contrib/lncli.bash-completion
$ sudo cp *.bash-completion /etc/bash_completion.d/

Bash completion will be enabled after your next login.


« Back: + Raspberry Pi