It would be a best practice to check if the file is being used by any process before deleting it.
This can be easily done by using lsof utility .
for example if i want to delete a file System.img . I will first check whether it is being used by any process or not.
# lsof System.img
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
qemu-dm 19376 root 10u REG 0,26 80015523840 1763 System.img
As you can see the qemu-dm process is using the file so i better of first find what qemu-dm is doing on the file and then delete it.
No comments:
Post a Comment