Skip to content

Common CLI Commands

This page is a quick reference for common commands you may use while managing your RoninDojo from the command line.

General

  • Shutdown device: systemctl poweroff
  • Reboot device: systemctl reboot
  • Change directory: cd
  • Kill process: Ctrl + C
  • List files/directories: ls
  • List all (incl. hidden): ls -la
  • Remove file: rm filename
  • Remove directory: rm -r ~/directory
  • Force remove directory: rm -rf ~/directory

Chmod

  • Make a file executable: sudo chmod +x ~/script.sh

Update

  • Sync & upgrade: sudo apt-get update && sudo apt-get upgrade

Drives

  • Show attached drive info: lsblk
  • Show drive space & mounts: df -h
  • Format to ext4: sudo mkfs.ext4 /dev/sda1
  • Create USB mount directory: sudo mkdir /mnt/usb
  • Mount all drives: sudo mount -a

Docker

  • Show containers & status: docker ps -a
  • List containers: docker container ls
  • Docker info: docker info
  • Docker root dir: docker info | grep "Docker Root Dir:"
  • Restart Tor: docker restart tor
  • Show version: docker -v
  • Docker status: systemctl status docker
  • Mount Docker on USB: sudo mkdir /mnt/usb/docker

systemctl

  • Restart Docker: systemctl restart docker
  • Stop Docker: systemctl stop docker
  • Start Docker: systemctl start docker
  • Disable at start-up: systemctl disable docker
  • Enable at start-up: systemctl enable docker
  • List active services: systemctl list-units --type=service
  • Reload daemon: systemctl daemon-reload

Git

  • Clone repository: git clone https://repo.git
  • Clone a branch: git clone -b development https://repo.git
  • Switch to a branch: git checkout development

Use nano to edit an existing file, create a file, and explore your filesystem.

  • Launch: nano or nano filename
  • Jump to the home directory: Ctrl + R then Ctrl + T
  • Go back a directory: Ctrl + O then Ctrl + T

Remove the RoninDojo repository, then clone it again:

Terminal window
rm -r ~/monorepo
git config --global http.proxy socks5h://127.0.0.1:9050
git clone --recurse-submodules http://2l2o5umijiwxjioxwpsvwxe6pr75tj7r5rggnl5ze256guwvtee3kpqd.onion/Ronin/monorepo.git

The command syntax is:

Terminal window
./dojo.sh <command> <module> <options>

Dojo commands

  • Display help: ./dojo.sh help
  • bitcoin-cli console: ./dojo.sh bitcoin-cli
  • Delete dangling images: ./dojo.sh clean
  • Install Dojo manually: ./dojo.sh install
  • Show Tor onion addresses: ./dojo.sh onion
  • Restart Dojo: ./dojo.sh restart
  • Start Dojo: ./dojo.sh start
  • Stop Dojo: ./dojo.sh stop

Logs

  • All container logs: ./dojo.sh logs
  • Specific container logs: ./dojo.sh logs node
  • Error logs (up to 500 lines):
Terminal window
./dojo.sh logs node -n 500 | egrep "ERROR|error"

Use Ctrl + C to exit at any time.

Other

  • Blockchain info: ./dojo.sh bitcoin-cli getblockchaininfo
  • Display Dojo version: ./dojo.sh version
  • Network info: ./dojo.sh bitcoin-cli getnetworkinfo
  • Upgrade Dojo: ./dojo.sh upgrade