Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
With only nine file descriptors available to you, you'd think that it wouldn't be too hard keeping things straight. Sometimes, however, it's easy to get lost when trying to keep track of which file descriptor is redirected where. To help you keep your sanity, the bash shell provides the lsof command.
The lsof command lists all of the open file descriptors on the entire Linux system. This is somewhat of a controversial feature, as it can provide information about the Linux system to non-system-administrators. Because of this, many Linux systems hide this command so that users don't accidentally stumble across it.
On my Fedora Linux system, the lsof command is located in the /usr/sbin directory. To run it with a normal user account, I have to reference it by its full pathname: