Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In many cases "lsof" is not installed on the machines that with I have to work, but the "function" of lsof would be needed very much (ex. on AIX). :\

Are there any "lsof" like applications in the non-windows world?

UPDATE: for ex.: I need to know that what processes use the "/home/username" directory?

share|improve this question
Could you be more specific, please? What systems apart from AIX (which is definitely supported by lsof) do you have in mind? Or is there only one specific type of use of lsof you have in mind? Generally: why not lsof? – rozcietrzewiacz Aug 12 '11 at 6:25
I'm using Linux 2.6.18-92.el5 GNU, and I don't have lsof, nor do I have the capability to use lsof :( – SSH This Jan 11 '13 at 17:52
up vote 13 down vote accepted

I know of fuser, see if is available on your system.

share|improve this answer
what do i have to give fuser as parameter to list all open files on a system? :O ty! – LanceBaynes Aug 12 '11 at 8:08
The command sudo fuser -vm / 2>&1 | awk '$3 ~ /f|F/' | less can show all processes having open files on the filesystem mounted on /. See man page for specific help. – enzotib Aug 12 '11 at 8:18
TY! it gives output like this: pastebin.com/raw.php?i=2z19g6Rk - i googled for it, but i can't find any way to output ex.: "gnome-screensaver", not "gnome-screensav" - so how can i output it with wide command names? :O – LanceBaynes Aug 12 '11 at 8:29
it gives the same output for: pastebin.com/raw.php?i=Fe3EJvUv – LanceBaynes Aug 12 '11 at 8:33
Something like this: sudo fuser -vm / 2>&1 | awk '$3 ~ /f|F/' | while read user pid flags rest; do printf '%10s %10s %10s %s\n' $user $pid $flags "$(</proc/$pid/cmdline)"; done | less – enzotib Aug 12 '11 at 8:33

The Unix Rosetta Stone is a good resource for this kind of questions. It mentions a few alternatives for lsof (see below). Do not however that lsof is the de facto standard application for what it does.

If all you want is to find the process ID(s) that have a particular file open, then you can use fuser on any POSIX-compliant system.

On operating systems with a /proc directory, you can query the files open by a process (the reverse from lsof's most common mode of operation) through information in /proc. Some operating systems have commands for that:

share|improve this answer

If you happen to run Solaris, an alternative to lsof, which isn't installed by default and might choke on ZFS, is pfiles.


pfiles /proc/*

share|improve this answer

This should do the trick. It'll give the all the file descriptor mappings except those which:

  • you don't have permission to view, or
  • are for files which contain the string "Permission denied"
( find /proc -mindepth 1 -maxdepth 1 \
  | grep -E [0-9]+ | xargs -n 1 -I% find %/fd \
  | xargs ls -l \
  | grep -v "Permission denied" ) 2>/dev/null \
| cut -d' ' -f12- | less

If you already know you only care about the mappings for certain programs, you could instead use something more along the lines of:

pgrep "$exec" | xargs -n 1 ps -p
pgrep "$exec" | xargs -n 1 -I% find /proc/%/fd | xargs ls -l | cut -d' ' -f12- | less
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.