I have a Mac running MacOS 12.3.1. I've noticed that all over my file system, there are hidden files from Microsoft apps (Word, Excel, PowerPoint, etc.) that start with ~$. All of these hidden files have similar names to files I've created in the past, but are often in different directories than the originals. For example, if I had created a file named name_of_file.docx, I might find a hidden file named ~$me_of_file.docx. I found this discussion thread that says these are temporary files used to store updates to a document before it is saved. However, even when I don't have any Microsoft files open, I can still find dozens of these files on my computer. I would probably ignore them except when I back up my files with Google Drive, all of those ~$ files get backed up too. So my question is, is there any way to stop these files from piling up on my computer, or at the very least, stop them from being backed up to Google Drive?
I know 2 ways of doing this (there might be more), through:
- Only do this if you are sure what this is about.
- Erasing/deleting files that are usually hidden can lead to some programmes to malfunction and/or even render your system/OS/computer unusable! (Until you reinstall, that is.)
~$files generated by Microsoft Office (i.e., Word, Excel, etc.) are usually erased after the file has been closed. In some cases, like when files are saved on a cloud/online disk, the latter can "throw back" to the local disk those files, hence the question. Don't erase those shadow/hidden files if the main file is open. To be on the safe side, quit the application altogether before erasing/deleting any of those
- Open a folder/directory where you know you have shadow/hidden files (such as those starting with
~$(usually generated by Microsoft apps such as Word, PowerPoint, etc.)
- Press cmd-shift-. (that is command, shift and period keys; source pcmag)
- Shadow/hidden files will appear
- Select individually or in batch as you usually do in Finder (individual click, click and shift-click, click and command-click)
- Delete it/them as usual in Finder
- As a precaution press cmd-shift-. again to hide shadow/hidden files.
Terminal (Source: my own trial and error)
- Launch Terminal (Applications → Utilities → Terminal)
cdto the folder/directory where you have your
~$generated files (e.g.,
- List the files in the folder/directory (e.g.,
- Although neither of the above example commands show shadow/hidden files, they will show files starting with
~$. If you want to see all hidden files, type
ls -al, etc.
- Type or copy-paste:
ls -lagain to be sure the files have been deleted.
Explanation of the commands
cd= change directory
~/= root folder/directory of the current user/profile (root directory of the system is
ls= list (options are preceded with
lwill list the files and folders/directories in the current folder/directory in vertical list format, option
awill list all files and folders/directories including the hidden ones [those starting with a
.], etc. Options can be combined, e.g.,
rm= remove (i.e., delete)
*= wildcard (thus
rm '~$'*= remove files that start with
~$. Keep in mind that
rmalone will not remove folders/directories, only files, for that you will have to lookup options such as
-R, but beware of their danger - see the warnings above)
- All Terminal commands have their manual. Simply type
Hope this helps
Terminal.app and change to the desire directory.
Start surveying your directory using:
find . -name "~*" -type f
Then delete unwanted Microsoft temp files using:
find . -name "~*" -type f -delete
-name = "~*":: name begin with ~
-type ffilter object type is File
-deletedelete match output