So I\'m trying to learn d3, and the wiki suggested that
To view the examples locally, you must have a local web server. Any web server will work;
MYPORT=8888;
kill -9 `ps -ef |grep SimpleHTTPServer |grep $MYPORT |awk '{print $2}'`
That is it!
ps -ef
: list all process.
grep SimpleHTTPServer
: filter process which belong to "SimpleHTTPServer"
grep $MYPORT
: filter again process belong to "SimpleHTTPServer" where port is MYPORT (.i.e: MYPORT=8888)
awk '{print $2}'
: print second column of result which is the PID (Process ID)
kill -9 <PID>
: Force Kill process with the appropriate PID.
It seems like overkill but you can use supervisor to start and stop your simpleHttpserver, and completely manage it as a service.
Or just run it in the foreground as suggested and kill it with control c