Use Terminal to see which processes are using your Internet connection

How to use the Terminal to see what Mac processes are accessing the internet

body>

If you've ever wondered about which programs are using your internet connection at any point in time, here's one way to find out using Terminal. Open Terminal, in Applications > Utilities, and run this command:

lsof -P -i -n | cut -f 1 -d " " | uniq

When you press return, you'll see a list of processes that are using the internet connection. At the time I wrote this, my output looked like this:

COMMAND AppleVNCS PTHPasteb SystemUIS aosnotify iTunes GrowlHelp Transmit iChatAgen firefox-b VPNClient Mail

The first row, COMMAND, is just the column header. Below that are the processes that are using the internet connection. Most of the time, they are self-explanatory, or can be figured out with relative ease. On my list, most of the entries are pretty clear, but perhaps not aosnotify. A bit of work with Google, though, determines that that process is related to MobileMe syncing.

If you just want to use this command, you know all you need to know now. If you're curious how it works, though, then keep reading.

While the command may look complex, it's actually three relatively simple commands strung together with the pipe (|) symbol. The first one, lsof -P -i -n, runs lsof to list open files, with options set to focus only on those connections using the Internet connection (-i), and to not try to convert port and host numbers into names (-P and -n).

The output from this command is then sent to cut, which cuts out everything except the first field (-f 1), based on using spaces to delimit fields (-d " "). Finally, that output is sent to uniq, which strips out duplicate entries from the list—without this last bit, you'd see a lot of repetition in the list, because every open app will have multiple open files.

That's all there is to it. Thanks to commandlinefu.com for posting this useful tidbit.

Latest breaking 24h news around the world Latest breaking 24h news around the world - Page 2 Latest breaking 24h news around the world - Page 3


LATEST NEWS

NEWS RELATED

Cowboy Bebop reveals super-stylish title sequence at Netflix Tudum fan event

© Provided by CNET John Cho as Spike Spiegel. Netflix The strike rate for live-action anime remakes has — so far — not been good. Can Netflix change this with Cowboy Bebop? Based on what we’ve seen at this point… probably? After announcing a killer cast and revealing that cast…

Read more: Cowboy Bebop reveals super-stylish title sequence at Netflix Tudum fan event

Germany Uses Converted Tesla Model Y To Showcase 'Green Hydrogen'

© InsideEVs tesla model y hyper hybrid Sadly, the Model Y is already much more efficient than it is once converted to a ‘Hyber Hybrid.’ A converted version of the Tesla Model Y was recently shown off in Germany as part of efforts to promote “green hydrogen.” The crossover was…

Read more: Germany Uses Converted Tesla Model Y To Showcase 'Green Hydrogen'

Neo-Nazis are Monetizing Social Media Platforms Like Facebook, Instagram, and Twitter

(Photo : Pexels/Pixabay) Facebook sites Neo-Nazis are still active online, and they are taking a different form. In Europe, the right-wing extremists are part of a premier martial arts group. Neo-Nazis are Making Money Online The German authorities have banned the tournament of the martial arts group twice. However, the…

Read more: Neo-Nazis are Monetizing Social Media Platforms Like Facebook, Instagram, and Twitter

Cobra Kai season 4 trailer karate chops its way into Netflix Tudum event

© Provided by CNET Netflix Following a wildly successful first three seasons on Netflix after being plucked from near obscurity on YouTube, Cobra Kai is back with a new teaser-trailer for season 4. The first look landed during Tudum, Netflix’s three-hour online fan event named after the distinctive drumbeat in Netflix’s…

Read more: Cobra Kai season 4 trailer karate chops its way into Netflix Tudum event

Don't turn up your TV's sharpness control. Instead, turn it down (way down)

© Provided by CNET Geoffrey Morrison/CNET Your TV has a lot of picture settings, like brightness, color and sharpness, and turning them all up might seem like a great idea. Who wants a picture that’s dim, colorless and dull, right? In reality, maxing out those adjustments can ruin your picture,…

Read more: Don't turn up your TV's sharpness control. Instead, turn it down (way down)

See inside the iPhone 13 Pro in iFixit's latest teardown

© Photo by Vjeran Pavic / The Verge iPhone 13 Pro The team at iFixit has a new teardown of the iPhone 13 Pro, finding it has an enormous battery and some small internal changes to how the components are laid out to accommodate the smaller notch on this year’s…

Read more: See inside the iPhone 13 Pro in iFixit's latest teardown

China frees Canadians after Huawei boss released

© CRISIGROUP/AFP via Getty Images COMBO-CHINA-CANADA-US-COURT-DIPLOMACY Two Canadians detained in China on spying charges have been released from prison hours after a top boss at Huawei resolved criminal charges against her in a deal with the U.S. Justice Department. Canadians Michael Kovrig and Michael Spavor were arrested in China in…

Read more: China frees Canadians after Huawei boss released

Amazon Great Indian Festival Sale: OnePlus 9 Pro gets massive discount; All you need to know

© Provided by Zee News Amazon India said that its Great Indian Festival (GIF) 2021 will begin on October 4, continuing its commitment to promote Small Medium Businesses (SMBs). Amazon GIF 2021, according to the firm, is dedicated to lakhs of small sellers, including over 75,000 local shops from 450…

Read more: Amazon Great Indian Festival Sale: OnePlus 9 Pro gets massive discount; All you need to know

Apple reportedly told a TV and movie workers' union its TV Plus had fewer than 20 million subs

Your iPhone already tracks your steps. What if it tracked your mood, too?

iPhone 13 Mini vs iPhone 12 Mini: Which one to buy?

On This Day in Space! Sept. 25, 2008: China launches its 3rd human spaceflight mission

Apple Tells Union That It Only Has 20 Million Subscribers, Allowing Them to Pay Lower Rates to Workers

How many satellites are orbiting Earth?

Prince Charles signs deal with Amazon Prime Video

CDC issues booster guildelines for Pfizer COVID vaccine, with Moderna and J&J next. What to know

OTHER NEWS