Skip to content

Instantly share code, notes, and snippets.

@jazlopez
Created December 9, 2022 02:50
Show Gist options
  • Select an option

  • Save jazlopez/a87a47a617ac1deb44c6584f8f3006c8 to your computer and use it in GitHub Desktop.

Select an option

Save jazlopez/a87a47a617ac1deb44c6584f8f3006c8 to your computer and use it in GitHub Desktop.
List/Filter TCP process information
# ----------------------------------
# List/Filter TCP process information
# Jaziel Lopez jazlopez @ github.com
# ----------------------------------
function __tcp_process__(){
local IFACE="tcp"
! [ -z $1 ] && IFACE="$IFACE:$1"
lsof -i $IFACE | awk '{print $2}' | tail -n+2 | xargs ps
}
alias tcp-process=__tcp_process__
# example
tcp-process 4444 # list selenium process if running
tcp-process # list all process (it might take some time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment