Hi There! I think your are looking for the nohup
command:
nohup cardano-node run --topology configs/mainnet-topology_new.json --database-path storage/ --socket-path storage/node.socket --host-addr 127.0.0.1 --port 3001 --config ../config.json > nohup.out 2>&1 &
this will preserve the cardano-node process to run even the terminal session ended.
the console log will be stored in nohup.out
file. And the process id will be printed out right after you executed the command. But this id can be get by ps -ef
command anytime.