Overly broad permissions can turn one compromised account into a much larger security problem. Learn how to reduce unnecessary access, review privileges, and apply least privilege across modern Linux systems. Review Linux Privileges×

Alerts This Week
Warning Icon 1 515
Alerts This Week
Warning Icon 1 515

Mastering Lsof for Open Files and Network Connections in Linux

22.Lock ScreenEffect Esm H446

The lsof command lists down open files and network connections on Linux. Here's how you can use it to your advantage.

Have you ever tried to close your shell or unmount a drive only to get an error that one or more files are in use? Or perhaps you've tried to edit a file only to find it's locked by another program? 

Maybe you're worried that someone has somehow gained unauthorized access to your Linux system. Using a tool called lsof, you can see which files are open, even over network connections.