<p>The <strong><code>fuser</code></strong> command lets me know which processes are using a file or directory.</p>

<p>I'm looking for command that does the opposite:  lets me know which files are being used by a process.</p>

<hr>

<h2>Update</h2>

<p>Forgot to mention that it's for a Solaris system.</p>

```
```
lsof -p <pid>
```
```
From
here
lsof stands for “
LiSt Open Files
”. This shell command seems deceptively simple: It lists information about files opened by processes on a UNIX box.
Despite its (apparent) modest mission statement, lsof is actually one of the most powerful and useful UNIX commands. Its raw power comes from one of UNIX’s design principle often described as ”in UNIX everything is a file”. What this means is that the lsof concept of an open file not only covers regular files but also the following:
Directories
Streams or network files (for example, Internet or UNIX domain sockets and NFS files)
Native libraries (for example, .soor .dylibdynamic libraries linked to a process)
Block and character special files (for example, disk volume, external hard drive, console, or mouse)
Pipes
Wait, I Cannot Find lsof on My System!
lsof is such a popular tool that it has been ported to pretty much all UNIX dialects (Linux, Mac OS X, BSD, Solaris, and so on). If it is unavailable on your box, use your usual package management system to install it. You can find lsof packages for Solaris on
Sun Freeware
.