Questions tagged [fuser]
32 questions
15
votes
6 answers
Files being used by a unix process
The fuser command lets me know which processes are using a file or directory.
I'm looking for command that does the opposite: lets me know which files are being used by a process.
Update
Forgot to mention that it's for a Solaris system.

lamcro
- 6,069
- 18
- 57
- 70
8
votes
2 answers
What is the Windows batch equivalent of "fuser -k "?
I have a Unix shell script which will kill any process that is accessing a folder:
fuser -k ..\logs\*
Is there a Windows batch script equivalent to this? I am aware of TASKKILL but I'm not sure if it will do what I need. Does anyone know if this is…

Matt
- 2,503
- 4
- 31
- 46
7
votes
2 answers
How to monitor processes that accessed a particular file?
i know there's a fuser command that lists out pids of processes, but how do you continuously monitor what process accessed the file? (think behavior similar to tail -f filename)
say there's a process which writes to a file and releases the handle at…

the1plummie
- 750
- 2
- 10
- 21
5
votes
1 answer
How to check if file is being copied under macOS
Users on our network copy files on the server in a directory called "DropBox" with AFP connection, simply dragging them with the Finder.
A script running on the server checks periodically for the presence of new files inside "DropBox" and then moves…

Paolo
- 15,233
- 27
- 70
- 91
4
votes
3 answers
.nfs file can't be removed - resource busy, but PID unknown
There is a very large .nfs file on my system, and it's using a large amount of my disk quota. If I try to delete it, I get "rm: cannot remove '.nfs0000000001bd849100000001': Device or resource busy".
What's weird is that fuser -v…

joesideburns
- 41
- 1
- 1
- 2
4
votes
4 answers
How can I figure out which process is opening the certain tcp port?
I usually use fuser command to check pid opening the certain tcp port like the following
fuser 22/tcp //To get pid opening the 22 tcp port
I've got a reference board which running a embedded linux.
It have been already opening 22 tcp port for ssh…

Sparkleholic
- 78
- 1
- 6
3
votes
0 answers
Atom Package with SSHFS... fusermount: mount failed: Operation not permitted
I'm writing a Atom package which attempts to mount a remote filesystem via SSHFS and show it in a tree-view. I'm having issues with getting the mount to succeed. Specifically, as user 'wagoodman' if I type at the terminal the following:
sshfs -o…

wagoodman
- 143
- 2
- 7
2
votes
0 answers
Why does calling fuser with subprocess return more than one PID?
I have the following file (written for use with py.test):
# test_fuser.py
import subprocess
def fuser(filename):
return subprocess.check_output(['fuser', filename]).split()
def test_fuser_0(tmpdir):
test_file = tmpdir.join('test.txt')
…

Ceasar
- 22,185
- 15
- 64
- 83
2
votes
4 answers
Why does sshfs cause these Emacs artifacts?
After opening a file in emacs (over an ssh tunneled, sshfs mounted file system) I get symbolic links like this:
.#jobid.php -> ddh@localhost.localdomain.31678:1260471633
We have determined that these are emacs LOCK files.
The sshfs filessystem is…

Don
- 4,583
- 1
- 26
- 33
1
vote
0 answers
Smartest and cleanest way to see if there's a process capturing v4l2loopback a device
I have a gstreamer pipeline where I am pushing data to a v4l2loopback device and then picking it up from browser.
From gstreamer's C code what is the smartest way to see if browser is actively capturing from the device or not ?
I have used popen…

José Braga
- 19
- 3
1
vote
1 answer
How to check from within docker for an open file on a mounted dockerhost filesystem/volume
My app, running within its own docker container, needs to check if a file located on a mounted filesystem/volume is still open by another process on the linux dockerhost (not a process within the container of this app).
E.g. my app should only start…

Heiko Gruner
- 11
- 1
1
vote
2 answers
specifying IPv6 addresses to fuser
Using CentoS 5.5.
I have an Apache 2.x server running on port 9999 and I am trying to find it using fuser.
I can find it using netstat, i.e.:
netstat -an | grep 9999
outputs:
tcp 0 0 :::9999 :::* …

perlman
- 139
- 4
1
vote
4 answers
How to determine whether a file is open in a bash script on FreeBSD
I'm trying to port a Linux bash script to FreeBSD. The script needs to check if a file is open (for writing) before deciding whether or not to take some action.
On Linux, this was easy using the fuser command:
if [[ ! `/usr/bin/fuser "$FILE"` ]]
…

Stuart Howard
- 21
- 7
1
vote
0 answers
How fuser identified the issue - Cannot stat file /proc/1234/fd/3: Stale file handle?
Can someone explain how fuser -u reported this error and even how to recreate this in Linux? fuser didn't tell me exact file name, but just process information for file set and now the issue disappeared. How to get more info about this issue (maybe…

laimison
- 1,409
- 3
- 17
- 39
1
vote
5 answers
Kill all processes on specific port via Jenkins
I'd like to have a Jenkins job which kills all processes on port 5000 (bash).
The easy solution
fuser -k 5000/tcp
works fine when I execute this command in the terminal, but on Jenkins ("execute shell") marks build as failure.
I have tried…

trina24
- 11
- 1
- 3