"Invisify" files and directories in the Finder

G

gatorparrots

Guest
You can show and hide invisible . files (dotfiles) in the Finder using the defaults command in the Terminal:
Show all:
defaults write com.apple.finder AppleShowAllFiles '1'
Hide all:
defaults write com.apple.finder AppleShowAllFiles '0'
Then relaunch the Finder:
kill -1 `ps auxc | grep Finder | awk '{print $2}'`

If the invibility bit has been set by another method than prepending a . before the filename, you may be better off with an application that can hide/show these files/folders that have an 'invisible' flag set:

(outdated link removed)

or

(outdated link removed)

(Yes, there is an English version.)

Making files invisible
It is also possible to selectively make files & directories invisible rather easily.

If the file/directory to be made invisible is on the root level, the easiest solution is probably to add 'dirname' (where 'dirname' is the file/directory to be hidden) to the .hidden file that lists items on the root level of the boot volume (/) to keep hidden from the Finder. Then relaunch the Finder to affect the change. Launch Terminal.app and issue these commands exactly as they appear below:
sudo -s
cp -p /.hidden /.hidden.default
echo 'dirname' >> /.hidden
exit
kill -1 `ps aucx | grep Finder | awk '{print $2}'`


Alternately, if you have the Developer Tools installed, you can set the directory's invisbility bit:
/Developer/Tools/SetFile -a V /dirname

If it is a non-root level directory to be made invisible, the command would be along these lines:
/Developer/Tools/SetFile -a V /Volumes/drivename/dirname
This will set the visiblity bit of the named file/directory on the non-boot drive, thus making it invisible to the Finder.
 
Joined
Dec 23, 2002
Messages
454
Reaction score
1
Points
18
Location
California
Your Mac's Specs
15" iMac 700 MHz G4 640 MB
Thanks for the tip! HeHe "Invisify" HeHe
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
Thanx for the tip.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top