Changing a running database from terminal

I was wondering how I can start/stop or edit a Neo4j database from the terminal.
I have a running Neo4j database on a virtual machine, and I want to edit the port number from the terminal. Since the database is running on a virtual machine, I am unable to run and edit Neo4j desktop, I can only connect to it with the given bolt address and port.

How can you stop/edit the database from the terminal? I am using MacOS.