On macOS, hiding files and folders is not as straightforward as it is on Windows. If you want to protect sensitive files, there are several ways to hide them on your Mac.
1Open the "Terminal" application.
2Execute the following command:
chflags hidden [路径]
chflags nohidden [路径]
Hide or unhide by command
You can drag files or folders directly to the "Terminal" window to automatically fill the path. Or, hold down the ⌥Option
key and right-click the file or folder to quickly copy the path.
1Press ⌘Command ⇧Shift .
shortcut key to display all hidden files and folders.
2 In the Finder or on the desktop, select the file or folder you want to hide.
3 Press Enter and add a dot .
in front of the file name to modify the file name (delete .
to unhide it).
4 Press Enter to confirm the modification, and select "Use Point" in the pop-up window to confirm.
Add dot . before the file name to hide it
5 Press ⌘Command ⇧Shift .
shortcut key again to cancel showing hidden files.
Every macOS user account has a hidden Library
folder where application caches and other data are stored. You can move files or folders here to hide them.
1 Press ⌘Command ⇧Shift G
shortcut key to open the "Go to Folder" dialog box.
2Enter ~/Library/
and press Enter.
Access ~/Library/ folder
3Move the files or folders you want to hide into the Library
folder.
The above is the detailed content of 3 tips to easily hide files and folders on macOS. For more information, please follow other related articles on the PHP Chinese website!