#### Lsof #### Open files by ... ================= * Pid .. code-block:: bash lsof -p * User .. code-block:: bash lsof -u * Program .. code-block:: bash lsof -c Which command is using this port? ================================= .. code-block:: bash lsof -i : Which processes have an open TCP socket to remote-site ====================================================== .. code-block:: bash lsof -i TCP@remote:port Which processes are using this file? ==================================== .. code-block:: bash lsof /path/to/file What pids does that binary have? ================================ .. code-block:: bash lsof -t /path/to/command Find all open files in a directory =================================== .. code-block:: bash lsof +D /some/dir