1

I have a HTTP server that I startup using the following command

username@machine:~project/www$ http-server . --cors 

It typically starts on port 8080, but if enter ctrl+z and then try to run the same command again, it will start on port 8081.

How can I shut down the previous server so that 8080 becomes free again?

user1283776
  • 1,071

2 Answers2

2

If that's the first background process you've created you can simply use kill %1. If not you'll want to run jobs and check which number it has in that list.

l0b0
  • 7,453
2

Use ctrl+c to kill the process. ctrl+z just suspends it.

Further reading: What's different between Ctrl+Z and Ctrl+C in Unix command line?

Quentin
  • 1,724