OS X Finder Hacking

Lifehacker had a nice little tip today on showing how to show hidden files within finder. Showing hidden files is as easy (if not immediately guessable) as entering these two lines into a terminal window:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
(to hide files just change the TRUE to FALSE)
Knowing that I’d never remember the syntax for that ever again I put it into a simple bash script that can be ran from the command line. Read on to the rest of this post for the scripts and how to use them.
File #1: showall
#!/bin/bash
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder@echo off
echo ——————————————————————-
echo — Showing all files enabled. Use ‘./hideall’ to reverse this script
echo ——————————————————————-
File #2: hideall
#!/bin/bash
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder@echo off
echo ———————————————————————–
echo — Showing hidden files disabled. Use ‘./showall’ to reverse this script
echo ———————————————————————–
Now all you have to do is make the scripts executable. From the command line type in:
chmod +x showall
chmod +x hideall
Now, to use your new scripts type either ./showall or ./hideall inside of Terminal. Enjoy.
Aside: Is there a list somewhere of all these com.apple.something attributes? I’ve seen this same kind of thing many times before and I can’t understand how someone could stumble across the proper syntax…