Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

See Files & Ports an App Uses in Activity Monitor

· 5 min read · Home Tech

In this article
  1. Why Activity Monitor Has This Feature
  2. How to Open the Open Files and Ports Inspector
  3. What the List Shows You
  4. Common Uses and Real Scenarios
  5. Limitations and Things to Know
  6. Alternatives: lsof and netstat
  7. Frequently Asked Questions

You can see which files and network ports an application is using directly in Activity Monitor on macOS, but not in the main window—you need the Open Files and Ports inspector. This tool lists every file, directory, socket, and network connection that a selected process has open at that moment.

Why Activity Monitor Has This Feature

Activity Monitor is primarily a performance tool, showing CPU, memory, energy, disk, and network usage for every running process. The Open Files and Ports view is a less obvious but powerful diagnostic feature. It gives you a real-time snapshot of a process's open file descriptors, which include regular files, directories, sockets, pipes, and devices. This is useful when you want to know what an app is reading or writing behind the scenes, or which ports it is listening on for network connections.

How to Open the Open Files and Ports Inspector

  1. Launch Activity Monitor from Applications → Utilities, or search for it with Spotlight (Cmd+Space).
  2. Find the process you're interested in. You can use the search box in the top-right corner, or sort by name, CPU, or memory.
  3. Double-click the process row, or select it and click the Info button (the circled “i”) in the toolbar.
  4. In the info window that appears, click the Open Files and Ports tab.

You'll see a list that updates live. The columns show the file path or port description, the kind of resource (file, socket, etc.), and the access mode (read, write, etc.).

What the List Shows You

The list is a mix of file paths and network endpoints. For example, a web browser might show files like /Users/you/Library/Caches/Google/Chrome/Default/Cache/… and network sockets like tcp4 192.168.1.10:54321 → 93.184.216.34:443. That tells you the app has an open TCP connection to that IP address on port 443 (HTTPS). You'll also see Unix domain sockets (often used for inter-process communication), named pipes, and character devices like /dev/urandom.

For a server process, you might see lines like *:8080 (LISTEN) which means the process is listening on port 8080 for incoming connections. That's exactly how you can find out which app is using a particular port.

Common Uses and Real Scenarios

  • Find which app is using a port: If you get a “port already in use” error, open Activity Monitor, sort by name, and inspect likely candidates (like a web server or database). Look for a line with *:PORT (LISTEN).
  • Check if an app is reading a specific file: If you suspect an app is accessing a sensitive file, you can watch the list live while you perform an action in the app.
  • Verify an app's network activity: See if an app is connecting to a server you didn't expect. The IP address and port are shown, but not the domain name (though you can reverse-lookup the IP with nslookup or dig in Terminal).
  • Debug a hung app: If an app is stuck, the list might show a file on a network volume that isn't responding, or a socket waiting for data.

Limitations and Things to Know

  • The list is a snapshot—it updates constantly, but you can't pause it. For a static capture, use the lsof command in Terminal (e.g., lsof -p PID).
  • You can't filter or search inside the Open Files and Ports list. If there are many entries, you'll have to scroll.
  • The port numbers shown are the actual local and remote ports. For well-known services, you can look up the port number in /etc/services or online.
  • You can't close a file or kill a connection from this window—it's read-only. To close a file, you'd need to quit the app or use kill in Terminal (which is risky).

Alternatives: lsof and netstat

If you need more control or want to script the output, the command-line tools lsof and netstat are more powerful. For example, lsof -i :8080 shows which process is using port 8080, and lsof -p 1234 lists all open files for process ID 1234. netstat -anv -p tcp shows all TCP connections and listening ports. These tools give you the same information as Activity Monitor but with filtering, sorting, and the ability to save output to a file. For a one-off check, Activity Monitor is quicker; for repeated or automated checks, use the terminal.

Frequently Asked Questions

How do I find which app is using a specific port on Mac?

Open Activity Monitor, then use the Open Files and Ports inspector on each process until you see a line with *:PORT (LISTEN). That process is the one using the port. For a faster method, open Terminal and run lsof -i :PORT, which will list the process ID and name directly.

Can I see a file that an app opened and then closed?

No, Activity Monitor only shows currently open files and ports. Once an app closes a file, it disappears from the list. If you need a history, you'd have to use a file monitoring tool like fs_usage (requires root) or a third-party app that logs file access.

Why is the list so long? What are all these files?

Modern apps open many files at once: libraries, configuration files, caches, logs, fonts, and more. A web browser can easily have hundreds of open files. The list is a raw dump of file descriptors, so it includes everything from the app's executable to temporary files. You can ignore most of them; focus on the ones that match the file or port you're investigating.

Can I close a file or kill a connection from Activity Monitor?

No. The Open Files and Ports inspector is read-only. To close a file or connection, you'd need to quit the app or use a command-line tool like kill (which terminates the process) or lsof -c COMMAND | grep PATH to find the PID and then use kill -9 PID (dangerous). There's no safe way to close an individual file descriptor without terminating the process.

Does this work on all versions of macOS?

The Open Files and Ports feature has been in Activity Monitor for many years, including the current versions of macOS. The interface may look slightly different, but the functionality is the same. If you can't find it, make sure you're double-clicking the process row (not just selecting it) or look for the Info button.

Is there a way to see network ports without Activity Monitor?

Yes, use the Terminal command netstat -anv -p tcp to list all TCP ports in use, or lsof -i to see which processes own them. These commands give you more detail and are scriptable, but they require some familiarity with the command line.