Sample Header Ad - 728x90

how to kill java process forcefully and remove directory which is used by that process

0 votes
0 answers
281 views
I have one use case where I am killing a java process with pkill java, and after that, I want to remove certain directories. I have used rm -rf /pathtofolder but it gives: rm: cannot remove '/pathtofolder': Directory not empty Is there any way I can kill java forcefully, which allows me to remove directories (which are on an NFS share)? I am not sure how fuser will help here, or if I should use sleep 20 between pkill and rm commands. Please guide.
Asked by Samurai (95 rep)
Dec 21, 2022, 03:36 AM
Last activity: Dec 21, 2022, 05:50 AM