Linux Process Management: fuser Shows Which Process is Using Which Files
fuser, Files, and Processes
USER PID ACCESS COMMAND /home/juliet/filename.txt: juliet 13644 f.... more
The -m switch shows all process accessing the filesystem, which the file is on; or you can simply specify a filesystem rather than a file. So fuser -m /dev/sdb1 output looks like:
/dev/sdb1: 18647c 16875m 7122c 19579m 1606c 7258c 5760c 13644cMost of these processes are accessing the current directory (c), with a couple using shared libraries (m). Use the -v switch, to get more information.
To kill all processes accessing a particular file, use fuser -k filename.txt (add -i for a confirmation message before each kill). You can also use fuser on network ports: fuser -n tcp 21. This will show which process is using port 21 (useful if you get a 'port busy' message).
Article courtesy of ServerWatch
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 2Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative
- 3Linux Top 3: Fedora, Ubuntu and Gluster Lose Community Leaders
- 4Red Hat Enterprise Linux 7 Finally Hits the Big Time
- 5Linux Top 3: Tails 1.0, OpenMandriva Lx 2014.0 and Debian 7.5