Find yourself needing access to hidden files on your Mac? Well here's a simple little terminal command that will surely make your day!
Any web developer worth their salt has a bit of experience with .htaccess files. When it comes to basic web security, light url tailoring, and a handling a few 301 redirects - there's really no better approach then to tweak that bad-boy. Here's the problem though - when you pull one off your server it "magically" disappears. No worries your OS is just a little confused and here's why...
Your Mac assumes that any file starting with a period is a hidden system file, because most of them are... So you'll need to steal a little programer tactic to get around this obstacle.
Showing Hidden Files on your MacStart by launching Terminal (that's the DOS prompt-y looking application that you never seem to need). Once you've got it open type these EXACT commands.
defaults write com.apple.Finder AppleShowAllFiles TRUENow you've got to relaunch Finder by killing it. Here's how:
Once you've got your adjustments made, you'll just need to revert back to the normal setting (trust me, it saves a lot of clutter and prevents possible 'deleting issues'). To the default settings, just type the following:
defaults write com.apple.Finder AppleShowAllFiles FALSEAgain you'll need to kill the Finder - use:
killall FinderThat’s it champ! Pretty slick right?
Show Hidden Files via Mac Save DialogueYou can easily show hidden files in any Mac OS X save dialogue box by hitting Command+Shift+Period. Another quick way to see hidden files is by using the "ls" command in Terminal. At the command line, type the following:
ls -aThe -a flag tells the ls (list) command to show all contents, including hidden files. You then just need to specify the directory that you want to see the files in:
ls -a ~/Sites/somerandomsiteNow pop your collar and be sure to show off your skills to your "Newly-Mac" friends!