← 返回命令列表

Linux command

fuser 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Example

fuser path/to/file

Example

fuser -v path/to/file

Example

fuser 80/tcp

Example

fuser 53/udp

Kill

fuser -k path/to/file

Example

fuser -m /mnt/usb

Example

fuser -k 8080/tcp

说明

fuser displays the PIDs of processes using specified files or file systems. It can identify which processes have files open, executables running, or sockets in use, and optionally terminate them.

参数

-a, --all
Display all specified files, including those not accessed
-k, --kill
Kill processes accessing the file (SIGKILL by default)
-i, --interactive
Ask for confirmation before killing
-m, --mount NAME
Target processes accessing a mounted filesystem
-M, --ismountpoint
Only match if target is a mount point
-n, --namespace SPACE
Select namespace: file, tcp, or udp
-u, --user
Include process owner usernames
-v, --verbose
Display processes in ps-like format
-s, --silent
Operate silently
-4, --ipv4
Search IPv4 sockets only
-6, --ipv6
Search IPv6 sockets only
-SIGNAL
Send specified signal instead of SIGKILL
-l, --list-signals
List available signal names

FAQ

What is the fuser command used for?

fuser displays the PIDs of processes using specified files or file systems. It can identify which processes have files open, executables running, or sockets in use, and optionally terminate them.

How do I run a basic fuser example?

Run `fuser path/to/file` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in fuser?

Display all specified files, including those not accessed