1.fuser命令安装

yum install -y psmisc

2.fuser命令用户
2.1查看哪些进程使用到/dev/sda2设备

fuser -um /dev/sda2

2.2 杀掉打开memory文件的程序

[root@node01:/home/sa.haibo.he]$ fuser -m -k -i memory
/home/sa.haibo.he/memory: 1rce 2rc 4rc 6rc 7rc 8rc 9rc 10rc 11rc 12rc 13rc 14rc 16rc 17rc 18rc 19rc 21rc 22rc 23rc 24rc 26rc 29rc 30rc 31rc 32rc 33rc 34rc 35rc 36rc 37rc 38rc 39rc 45rc 46rc 47rc 48rc 56rc 58rc 59rc 60rc 62rc 76rc 115rc 301rc 303rc 304rc 305rc 306rc 309rc 311rc 312rc 313rc 314rc 315rc 321rc 323rc 324rc 325rc 326rc 327rc 328rc 329rc 330rc 331rc 332rc 333rc 334rc 335rc 338rc 339rc 340rc 341rc 342rc 343rc 344rc 345rc 347rc 348rc 349rc 350rc 351rc 352rc 353rc 354rc 355rc 356rc 357rc 358rc 359rc 360rc 361rc 362rc 363rc 364rc 365rc 366rc 367rc 368rc 369rc 370rc 371rc 372rc 373rc 374rc 376rc 377rc 379rc 380rc 381rc 382rc 383rc 384rc 415rc 416rc 446rc 487rc 488rc 498rc 499rc 513rc 514rc 515rc 516rc 517rc 518rc 519rc 520rc 521rc 522rc 523rc 524rc 616rce 647rce 652rce 754rc 757rc 758rc 759rc 760rc 761rc 762rc 763rc 764rc 798rce 800rce 802rce 804rc 805rc 827e 829rce 830rce 832rce 835rce 836rce 838rce 841rce 843rce 845rce 852rce 854rce 884rce 885rce 890rce 891rce 892rce 893rce 894rce 906rce 923rce 1176rce 1178rce 1180rce 1184rce 1187rce 1190rce 1192rce 1193rce 1479rce 1491rce 1573rce 1575rce 1650rc 1816rce 1830rce 1834rce 1840rce 1841rce 1848rce 1853rce 1855rce 1884rce 1892rce 1903rce 1921rce 1924rce 1927rce 1930rce 1940rce 1950rce 1954rce 1958rce 1964rce 1966rce 1967rce 1970rce 1971rce 1973rce 1982rce 1984rce 1988rce 1991rce 1994rce 1996rce 1997rce 2003rce 2006rce 2016rce 2020rce 2034rce 2053rce 2069rce 2435rce 2437rce 2444rce 2495rce 2499rce 2502rce 3409rce 3506rc 3691rce 3700rce 3796rce 3800rce 3811rce 3813rce 3822rce 3827rce 3829rce 3858rce 3884rce 3887rce 3891rce 3896rce 3903rce 3920rce 3921rce 3923rce 3926rce 3932rce 3933rce 3937rce 3943rce 3944rce 3945rce 3947rce 3950rce 3959rce 3967rce 3971rce 3975rce 3979rce 4017rce 5645rce 10461rce 10462rc 13651rc 14945rc 15923rce 15925rce 15927rce 15930rce 15934rce 15936rce 15940rce 15943rce 15945rce 15948rce 15950rce 15952rce 15954rce 15956rce 15958rce 15960rce 15962rce 15964rce 15966rce 15968rce 15970rce 15972rce 15974rce 15976rce 15978rce 15980rce 15984rce 15986rce 15988rce 15990rce 15992rce 16014rce 16016rce 16018rce 16020rce 16022rce 16024rce 16026rce 16028rce 16030rce 16037rce 16039rce 16041rce 16043rce 16045rce 16047rce 16049rce 16051rce 16285rce 16476rce 16482rce 16486rce 16490rce 16493rce 17077rce 17083rce 17090rce 19424rce 19426rce 19967rc 20313rc 20619rce 21489rc 22715rc 23025rce 24580rce 26299rc 26896rc 26897rc 27801rc 28112rc 28124rce 28152rce 31184rce 31186rce 31195rce 31242rce 31244rce 31254rce 31258rce 31261rce 31264rce 31326rce 31333rce
Kill process 1 ? (y/N)

2.3 查看那些程序使用tcp的1521端口

[root@node01:/home/test]$ fuser -v -n tcp 1521
USER PID ACCESS COMMAND
1521/tcp: oracle 10461 F.... tnslsnr
[root@node01:/home/sa.haibo.he]$ fuser -v 1521/tcp
USER PID ACCESS COMMAND
1521/tcp: oracle 10461 F.... tnslsnr

3.列出fuser支持的命令

[root@node01:/home/test]$ fuser -l
HUP INT QUIT ILL TRAP ABRT IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM
STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS
UNUSED