All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Security
Security
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

A one-liner for freeing ports on OS X

By

Henry Desroches

3y agoen

Source

henry.codesA one-liner for freeing ports on OS Xhenry.codes
Snippet from the RSS feed
TL;DR One of my most-frequently searched dev tasks over the course of my career thus far has been the “how do I find what process is on a port” to “how do I kill a given process” wombo-combo — there’s always some memory-leaky service running that ctrl + c isn’t tough enough for. Figured it’d be good to write a quick shell function for doing just this. Before I get into the explainer, here’s the code: function killport { echo '🚨 Killing all processes at port' $1 lsof -ti tcp: $1

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.