Skip to content

Instantly share code, notes, and snippets.

@johnsosoka
Created August 22, 2023 02:44
Show Gist options
  • Select an option

  • Save johnsosoka/d5d53c62718b644f0d4e14a9ad7459be to your computer and use it in GitHub Desktop.

Select an option

Save johnsosoka/d5d53c62718b644f0d4e14a9ad7459be to your computer and use it in GitHub Desktop.
kills jekyll...or whatever is running on port 4000
#!/bin/bash
# Find the process ID of Jekyll running on port 4000
jekyll_pid=$(lsof -i tcp:4000 -t)
# Check if the process ID is found
if [ -n "$jekyll_pid" ]; then
echo "Jekyll is running with PID $jekyll_pid. Killing the process..."
# Kill the process
kill -9 $jekyll_pid
echo "Jekyll process has been killed."
else
echo "Jekyll is not running."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment