Created
December 9, 2022 02:50
-
-
Save jazlopez/a87a47a617ac1deb44c6584f8f3006c8 to your computer and use it in GitHub Desktop.
List/Filter TCP process information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------- | |
| # 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