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
Table of contents Introduction Install 1. Create ...
Table of contents 1. Home Page Production 1. Prod...
I recently encountered a bug where I was trying t...
Nextcloud is an open source and free private clou...
Table of contents Preface start React Lifecycle R...
Preface: I'm currently learning Linux and .Ne...
By applying it, some public areas of the website c...
What are HTTP Headers HTTP is an abbreviation of ...
Table of contents 1. mixin.scss 2. Single file us...
Here is a case of modal box dragging. The functio...
Preface Still referring to the project mentioned ...
Table of contents 1. Create a sql script file con...
Recently, I needed to test the zoom video confere...
Principle: First hide the input element, then use...
Using the knowledge of CSS variables, I will dire...