describe: fuser can show which program is currently using a file, mount point, or even network port on the disk, and provide detailed information about the program process. fuser displays the process IDs that are using the specified file or file system. By default each file name is followed by a letter indicating the access type. In the zkfc log, there is a warn: PATH=$PATH:/sbin:/usr/sbin fuser -v -k -n tcp 8090 via ssh: bash: fuser: command not found The reason is that when minimizing the installation of centos, there is no fuser command
grammar:
The access types are as follows: c: represents the current directory Common options -a: Display all files specified in the command line. By default, only accessed files will be displayed. parameter File: can be a file name or a TCP or UDP port number. Example of use: Display information about the processes using a file This command is very useful when umounting, and can be used to find out what else is using this device. $ fuser -um /dev/sda2 /dev/sda2: 6378c(quietheart) 6534c(quietheart) 6628(quietheart) 6653c(quietheart) 7429c(quietheart) 7549c(quietheart) 7608c(quietheart) Kill the program that opens the readme file Here, you will be asked to confirm before killing. It is best to add -v so that you know which process is going to be killed.
Check which programs use TCP port 80
Application of different fuser signals Use the -l parameter to list the signals known to fuser. [root@_mongodb_117 ~]# 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 fuser can send a known signal to the process accessing the specified file instead of the SIGKILL sent by the -k parameter by default. For example, if you just want to suspend the process, then sending the HUP signal will suffice.
User Process ID Permission Command /root/install.log: root 3347 f.... tail [root@_mongodb_117 ~]# fuser -k -SIGHUP /root/install.log /root/install.log: 3347 [root@_mongodb_117 ~]# fuser -v /root/install.log To list the process numbers of local processes using the /etc/passwd file, enter:
To list the process numbers and user login names of processes that use the /etc/filesystems file, enter:
Summarize This is the end of this article about the detailed usage of fuser command in Linux. For more related Linux fuser content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL conditional query and or usage and priority example analysis
>>: JavaScript to implement random roll call web page
1. Create a new user: 1. Execute SQL statement to...
This article shares with you how to use the Vue s...
The function has been implemented a long time ago...
This is an effect created purely using CSS. To pu...
What is an index? An index is a data structure th...
We live in a visual world and are surrounded by m...
Achieve resultsRequirements/Functionality: How to...
This article shares the implementation method of ...
A transaction is a logical group of operations. E...
Today, when testing the null value, I found a sma...
Empty link: That is, there is no link with a targ...
Table of contents Introduction to frm files and i...
<br /> Note: All texts, except those indicat...
Table of contents specification a. The page file ...
My environment: 3 centos7.5 1804 master 192.168.1...