All notes
Finder

Tricks

Hide files and folders

macworld.com.

Hide them in the Library Assuming your /Library folder is hidden (that’s the default in OS X Mountain Lion), hold down the Option key as you open the Finder’s Go menu.


mv filename .filename

chflags -R hidden files/dirs
chflags -R nohidden files/dirs

#----- setfile

# Set visibility attribute to invisible
# iPod's Music folders are hidden by this way.
setfile -a V files/dirs # Make invisible.
setfile -a v files/dirs # Make visible again.

#----- Extended attr: ls [email protected], xattr

ls -l
# [email protected] 17 i337146  GLOBAL\Domain Users  544 Dec  8  2011 F02
# drwxrwxrwx  17 i337146  GLOBAL\Domain Users  544 Dec  8  2011 F01

# To list the extended attributes, use "ls [email protected]"
# https://superuser.com/questions/155458/what-does-the-mean-on-the-output-of-ls-on-os-x-terminal
ls [email protected] F02
# com.apple.FinderInfo	     32
# com.apple.metadata:kMDItemWhereFroms	    172
# com.apple.quarantine	     64

# "com.apple.FinderInfo	     32" indicates it is invisible. Use "setfile -a v" to toggle it to visible.

# Or directly use
xattr F02
# com.apple.FinderInfo	     32
# com.apple.metadata:kMDItemWhereFroms
# com.apple.quarantine