OS X: hide/unhide files and folders

Let’s use ~/Desktop/1.txt and ~/Desktop/1/ for example.

Hide files and folders:

chflags hidden ~/Desktop/1.txt

chflags hidden ~/Desktop/1/

Unhide files and folders:

chflags nohidden ~/Desktop/1.txt

chflags nohidden ~/Desktop/1/

If you installed Apple developer command line tool in Xcode, you can also use the following ones.

Hide files and folders:

setfile -a V ~/Desktop/1.txt

setfile -a V~/Desktop/1/

Unhide files and folders:

setfile -a v ~/Desktop/1.txt

setfile -a v ~/Desktop/1/

It is also true that these two command makes the same effects, so you can simply use any combination of them. For example, use chflags to hide one file and use setfile to unhide it.

Source link:

http://osxdaily.com/2009/08/11/hide-any-file-or-folder-by-making-it-invisible-to-the-mac-os-x-finder/

http://osxdaily.com/2012/01/06/hide-folders-mac/

Advertisements