get rid of locked Word file on Mac
In Terminal, if the actual filename is ~$file.docx then use,  rm '~$file.docx', or whatever the actual file name is. If it's ~file.docx, use: rm '~$file.docx'
The above rm commands assume you are in the directory containing the target file, otherwise use its fully qualified pathname.
As the file is hidden, you can use either chflags nohidden '&lt;file name&gt;' or SetFile -a v '&lt;file name&gt;', where '&lt;file name&gt;' is the actual name or fully qualified pathname of the target file,  to first unhide the file in Terminal and then in Finder right-click and select: Move to Trash