Thursday, May 3, 2007

Pesky hidden files, beware

I was doing some spring cleaning on my hard drive this morning ("rm -Rf *" -- no, NOT in my home directory...). As an afterthought, I did a "ls -al" to verify that, indeed, everything was gone. To my surprise, there were a couple of StuffIt droppings left behind. ".$$ StuffIt Temp 1143648937" Big 'uns, too. Almost a gig worth of dead air. Them files needed killing.

Strange, though, that they wouldn't die. "rm -Rf *" is the command-line equivalent of "slash and burn, take no prisoners". I was the owner of the files, yet couldn't delete them. Perhaps it was a permissions problem. "sudo rm -Rf *" foiled my all-powerful alter ego, Root, as well. Apparently these files were laced with kryptonite.

The leading "." makes the directory or file hidden, but it shouldn't tattoo it to my hard drive. I'm pretty sure that it was the dollar signs that was slipping bash a mickey. Surrounding the file name in single quotes didn't help -- "rm -Rf '.$$ StuffIt Temp 114364'". Neither did letting the bash shell tab-complete the file name -- "rm -Rf .\$\$\ StuffIt\ Temp\ 114364". This was really beginning to harsh my mellow.

So, I pulled out the big guns. TinkerTool, among other things, gives Finder x-ray vision. It is, refreshingly, a free utility in a sea of $20 Mac add-ons. The very first checkbox on the very first tab of the utility is what I needed -- "Show hidden and system files". Once Finder could see 'em, Finder could delete 'em. Odd that the GUI came through when the CLI failed, but I'm not asking questions.

As TinkerTool rode off into the sunset, I heard him mutter under his breath, "I love the smell of Napalm in the morning." Me too, TT. Me, too.

1 comment:

Rapha said...

I haven't tried it, but what you probably needed was:

rm -Rf .*

The * wildcard doesn't include files beginning with dot.