How to Check Open Network Connections on a Mac Using Terminal

Illustration for How to Check Open Network Connections on a Mac Using Terminal

Quick Answer To see open network connections on your Mac, open Terminal and run: lsof -i This lists processes that currently have network sockets open, including the application name, process ID, user, network protocol, local address, and remote address. For a more focused view of active TCP connections, use: lsof -nP -iTCP -sTCP:ESTABLISHED You can … Read more

How to Check DNS Settings and DNS Resolution in Terminal on a Mac

Illustration for How to Check DNS Settings and DNS Resolution in Terminal on a Mac

DNS, or the Domain Name System, translates website names such as 4macos.com into IP addresses that computers use to connect. When browsing is slow or a website will not open, checking DNS settings and testing DNS resolution in Terminal can help determine whether the problem is with your Mac, your network, or the DNS service … Read more

How to See Which Apps Are Using the Network on a Mac Using Terminal

Illustration for How to See Which Apps Are Using the Network on a Mac Using Terminal

If your Mac seems to be using the network unexpectedly, Terminal can show which processes currently have network connections. The most useful built-in command is lsof, which lists open files—including network sockets. Open Terminal from Applications > Utilities, then run: lsof -nP -i Look at the COMMAND and PID columns to identify the app or … Read more

How to Find Which Process Is Using a Port on a Mac Using Terminal

Illustration for How to Find Which Process Is Using a Port on a Mac Using Terminal

When an app cannot start because a port is already in use, Terminal can show which process owns that port. The most useful command is lsof, which lists open files—including network connections—and identifies the process using a specific port. Quick Answer Open Terminal from Applications > Utilities. Run the following command, replacing 8080 with the … Read more

How to Check APFS Containers and Volumes in Terminal on a Mac

Illustration for How to Check APFS Containers and Volumes in Terminal on a Mac

Quick Answer Open Terminal from Applications > Utilities, then run: diskutil apfs list This displays the APFS containers and volumes currently visible to macOS, including identifiers, capacity information, roles, and encryption status when available. For a shorter overview of all connected storage devices, run: diskutil list These commands inspect storage only. They do not erase, … Read more