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

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

For example, I need to know which processes use the /home/username directory?

  • 1
    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? Aug 12, 2011 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, 2013 at 17:52
  • Related question: how to check open file without lsof Jun 27, 2017 at 15:43

6 Answers 6


I know of fuser, see if it's available on your system.

  • 1
    what do i have to give fuser as parameter to list all open files on a system? :O ty! Aug 12, 2011 at 8:08
  • 3
    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, 2011 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 Aug 12, 2011 at 8:29
  • it gives the same output for: pastebin.com/raw.php?i=Fe3EJvUv Aug 12, 2011 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, 2011 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 note 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:


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/*


My version, with only a little less running of utilities:

for proc_pid in $(find /proc -maxdepth 1 -name "[0-9]*"); do \
    ls -l ${proc_pid}/fd 2>/dev/null \
    | grep -q "$search_term" \
    && echo "${proc_pid#/proc/}"; \

Admittedly, it may not handle all corner cases, but is working in my use-case.


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

Sometimes lsof is installed in /usr/sbin

If /usr/sbin is not part of your $PATH, you could miss the command even installed.

Check it with

whereis lsof
lsof: /usr/sbin/lsof /usr/share/man/man8/lsof.8.gz
  • The OP said that lsof was not installed and asked for alternatives...
    – Jeff Schaller
    Jun 5, 2019 at 9:54

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