I have somehow generated a file on a network mounted volume that is in the busy state, and I have no knowledge of what could be using it. I want the file gone, and am not really concerned about whatever might be trying to use the file. I will document the process by which I created the file below.
Also, I know that there was a similar question asked before Here, but none of them have worked for me, and I can't comment on them with my current reputation to ask for clarification.
$echo "day" > other_tmp $cat other_tmp day $sed "s/day/night/" <other_tmp>other_tmp $vi other_tmp
It is empty, so I try to re-populate it to try again.
[i] day [esc] [:wq!]
Something goes wrong, I get the following back
"other_tmp" 1L, 4C written E207: Can't delete backup file Press ENTER or type command to continue
The q! makes me skip this though.
$ls other_tmp other_tmp~ $rm other_tmp $rm other_tmp~ rm: other_tmp~: Resource busy $rm -f other_tmp~ rm: other_tmp~: Resource busy
That's where I got to when I started looking for help.
Most of the answers I've found suggest using
$lsof other_tmp~ $
Others suggested renaming the file and then using finder to kill it.
$mv other_tmp~ new_name
It moved to a new name successfully. But finder gave me the following error when doing
Move to Trash.
The operation can’t be completed because the item “new_name_2” is in use.
And this is where I am now. Except I ran through the process again to see if it was reproducible so now I have
I can't restart the volume, because I don't have those permissions. I just want to delete the files. Its not a terrible high priority given that their filesize is 0, but they are are enough of a nuisance that I have gone this far to try to remove them.
$fuser new_name new_name: $