author

Command Cheat Sheet

Linux Server Commands

Check a specific port (e.g. 3000)

lsof -i tcp:3000

List active localhost ports

lsof -i -P -n | grep LISTEN

-i = Lists IP sockets

-P = Do not resolve port names (list port number instead of its name)

-n = Do not resolve hostname (no DNS)

Kill a process running on particular port (e.g. 8080)

kill -9 $(sudo lsof -t -i:8080)

Find running node process

ps aux | grep node

a = show processes for all users

u = display the process's user/owner

x = also show processes not attached to a terminal