How to run background command with nohup

Problem

redis-server
redis-cli

Solution

redis-server &
nohup redis-server &
cat nohup.out
nohup redis-server redis.conf &
nohup redis-server redis.conf >/dev/null 2>&1 &
nohup redis-server &
redis-cli
nohup redis-server &
echo $! > /tmp/redis-server.pid
kill $(cat /tmp/redis-server.pid)

Script

Demo

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store