Identifying which processes are accessing a file or socket

Sometime you want to know which processes are blocking you from unmounting a directory. To list which processes are accessing a file, directory or socket, you can use the following command:

fuser -c /directory_name

Similarly if you want to SIGKILL these processes you can use the -k switch:

fuser -kc /directory_name

...Quite a handy *nix tool!