I'm sure this is a really stupid question and it's probably already been asked a dozen times on this site, and I just don't know which keywords to search. I'm still really new to managing a server and new to the command line in general, but it's something I've been wanting to try for a long time.
Right now I have Ubuntu Server (no GUI) running a Node.js web server.
How can I keep Node running while executing other commands on the command line?
For example:
node /var/www/my_app.js
This command prevents me from running other commands until I terminate it with Ctrl + C
. But what if I want to run a redis-cli
command while leaving Node running in the background? In other words:
- How can I exit out of the Node.js context without stopping the Node server? and
- After I do (1), how can I return to the Node context?
I don't know if (2) makes sense for the node
command, but, for example, if I ran nodemon
instead, I can run a rs
(restart) command while nodemon
is running.
Thanks, and apologies if this is a duplicate and/or really obvious question.