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

--

--

--

remarkablemark.org

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Sometimes, Boring is Better

tyhackme: Investigating Windows write up

Of Computer Memory | Part 1

Google Training: Day 5

USE OF BREAK, CONTINUE AND PASS

Zero to Hero in Python in 30 days: Day 20: Basic Introduction to OOP

How to Get Started With WordPress Development

Can Stateful Builder Step into shoes of Stateful Widget?

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
remarkablemark

remarkablemark

remarkablemark.org

More from Medium

Logrotate : clean your logs files

Integration of Keycloak in TYK Gateway Middleware

All you need to know about Auth in the Web. Identity and Access Management.

Push multiple files under a single commit through GitHub API