Recently, Textfilebusy was prompted when running commands in linux. Baidu found that the fuserxxx command was used to check which process occupied the file and then shut down the process.
Run the fuser xxx command to check which process occupies the specified file, and then close the process to solve the problem.
Note: If the xxx command is enabled in common root mode, but is used in common users, fuser xxx has no result.
Switch to root usage, and then execute fuser xxx. The process number is displayed and killed.
Eg:
#./Xfbdev: 0-fp/usr/share/fonts/X11/misc
./Xfbdev: Text file busy
$ Fuser Xfbdev
$ Sudo su
# Fuser Xfbdev
Xfbdev: 28784e
# Ps aux | grep Xfbdev
Root 28784 0.9 0.2 4608 2640 pts/0 S +./Xfbdev: 0-fp/usr/share/fonts/X11/misc
Root 30708 0.0 0.1 3792 1248 pts/1 S + grep Xfbdev
Solution to Text file busy
Author: liucy
When using scp to copy files across servers, a Text file busy error occurs, leading to the failure to complete the operation. after searching, we learned that the error indicates that the file is being used by a process, unable to copy because it is locked. After verification, we learned that using the fuser command can solve the above problem. The specific command is as follows:
Fuser-cdkux filename