Skip to content

Instantly share code, notes, and snippets.

@yzhong52
Last active August 12, 2020 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yzhong52/4f86787f1a0cdd54ba038e177107bdec to your computer and use it in GitHub Desktop.
Save yzhong52/4f86787f1a0cdd54ba038e177107bdec to your computer and use it in GitHub Desktop.
Check the service using port (mac)

Check The Process Using Port

In ~/.zshrc, put the following:

pidportfunction() {
    lsof -n -i4TCP:$1 | grep LISTEN
}
alias pidport=pidportfunction

Usage:

pidport 9994

Check the machine IP address

In ~/.zshrc, put the following:

alias whereami="ipconfig getifaddr en0"

Usage:

whereami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment