Forked from pwittchen/start-stop-server-in-background.sh
Created
April 19, 2019 01:37
-
-
Save bstavroulakis/d1780810e1c68cb964b445c845bac071 to your computer and use it in GitHub Desktop.
Starting and stopping simple HTTP server in background on Linux. After starting server and closing terminal, server should keep running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starting simple HTTP server with Python in background | |
screen -d -m python -m SimpleHTTPServer 7777 | |
# or for Python 3.x | |
screen -d -m python -m http.server 7777 | |
# killing process running with screen in background | |
kill -9 `top -n 1 | pgrep screen` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment