Apple Terminal
Read-only, can be slowFind What Is Using a Local Dev Port
A local server will not start because another process is already listening on the same TCP port.
Command
lsof -nP -iTCP:3000 -sTCP:LISTEN
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not use it to inspect remote servers. It only checks the local Mac.
Expected output
A row showing the command name, PID, user, and LISTEN socket for port 3000.
System impact
Read-only, can be slow. Nothing changes. The command reports the process listening on the port.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use when Vite, Next.js, Rails, Django, or another local server refuses to bind to a port.
When not to use it
Do not use it to inspect remote servers. It only checks the local Mac.
next steps
Related commands
Stop the Process Blocking a Dev Port
Free a stuck dev port without hunting through Activity Monitor.
lsof -ti tcp:3000 | xargs kill
Flush macOS DNS Cache
Changed DNS but your Mac still visits the old place? Flush the resolver cache.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Find Which Folder Is Eating Disk Space
When your Mac is full, start with the biggest folders in the current directory.
du -sh ./* 2>/dev/null | sort -h
See Exactly Which Command macOS Will Run
Before blaming npm, Python, or Git, check the binary your shell actually found.
command -v node && node -v
Check a URL Without Downloading the Page
Before opening a broken page in five browsers, ask the server for headers.
curl -I https://example.com
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.