fuser コマンドは、ファイル、ディレクトリ、またはソケットを使用しているプロセスを見つけるために使用される非常にスマートな UNIX ユーティリティです。また、プロセスを所有しているユーザーとアクセスの種類に関する情報も提供します。続きを読む --digitalocean.com
特定のディレクトリにアクセスするプロセスを表示するには、次を使用します。
fuser -uvm /somedir
以下の出力は、verbose モードで実行した場合に、fuse ユーティリティがファイルに関する情報を提供することを示しています。USER, PID, ACCESS and COMMAND
root@exampleuser-X55CR:~# fuser -v .
USER PID ACCESS COMMAND
/root: root 3378 ..c.. vim
root 3398 ..c.. bash
root 3449 ..c.. bash
root 19370 ..c.. bash
fuser
特定のファイルを開くプロセス ID を識別するのに役立ちます。
lsof
特定のプロセスによって開かれたすべてのファイルを見つけるのに役立ちます。
フューザーに関連するその他のオプションについては、man ページを確認してください。man fuser
ここにいくつかあります:
]$ fuser
No process specification given
Usage: fuser [ -a | -s | -c ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...
[ - ] [ -n SPACE ] [ -SIGNAL ] [ -kimuv ] NAME...
fuser -l
fuser -V
Show which processes use the named files, sockets, or filesystems.
-a display unused files too
-c mounted FS
-f silently ignored (for POSIX compatibility)
-i ask before killing (ignored without -k)
-k kill processes accessing the named file
-l list available signal names
-m show all processes using the named filesystems
-n SPACE search in this name space (file, udp, or tcp)
-s silent operation
-SIGNAL send this signal instead of SIGKILL
-u display user IDs
-v verbose output
-V display version information
-4 search IPv4 sockets only
-6 search IPv6 sockets only
- reset options
udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]