Hidden Files in OS X
One of the reason I switched to Apple's OS X as my main platform was the ability to get an environment that was both Linux-like, my favorite operating system, and Windows-like. Because as much as Linux has grown, Microsoft still has the upper hand on the desktop environment.
One of the things OS X shares with with Linux is the file system, particularly how files and directories are handled. In this case, I talking about how hidden files are handled. By default files or directories that begin with a . (period) are hidden from view. And while for most that is the best option, there are times you need to work with the hidden files and directories in Finder.
The easiest way to do unhide these files is from the command line. To do so, you simply open terminal and run:
defaults write com.apple.finder AppleShowAllFiles True
You then need to reset Finder so that the change can take effect. To do that type this:
killall Finder
Viola! You can now see a lot more files. However, typing that in every time you want to see the files is a pain, so lets make that process easier. To so so, we are going to take advantage of something those familiar with Linux/Unix will already be fans of. Aliases.
Since your files are unhidden at this point you can either open up finder to your directory at /users/username or you can do this from the command line. In Finder, just right click on the file .profile and open it with the text editor. From the command line do:
nano .profile
Ok, under the line export PS1="$ " we are going to add the following two lines:
alias unhide="defaults write com.apple.finder AppleShowAllFiles True; killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles False; killall Finder"
Close out terminal, and restart it. This will read your new aliases and load them. Basically what we have done is a create a new command, or if you will a shortcut. Every time you type unhide or hide and press enter, everything in " " will run just as if you type it all out. For the sake of consolidating I added ;killall Finder to the end of the original command so that it will run as soon as the first part is finished eliminating the need to run type it as well.
There you go, you can unhide and hide the hidden files with a simple command.
Comments
This article hasn't been commented yet.

Write a comment
* = required field