Since in *nix every thing is a file, When you try to find open files or file descriptor associated with a process you will see Actual file log, Unix Sockets, Library files, Network Sockets, /dev files and others.
lsof is a command to list all open files.
To list all open files or file descriptors by a process:
$ lsof -p PID
$ lsof -a -p PID
$ ls /proc/PID/fd
where PID is a process ID of any process that is running.
To count all open files by a process:
$ lsof -p PID | wc -l
$ ls /proc/PID/fd | wc -l
To list all open files:
To count all open files:
$ lsof | wc -l