If you own a Sony PSP or Sony CLIE and a Mac, chances are that you are seeing more than some red when you try to manage your data between Memory Sticks and your Mac. You are seeing a lot of invisible Mac files manifest themselves as “dot” files within the Sony file systems.

You can get rid of all of these invisible files (e.g., .DS_STORE, .TRASH, etc.) quickly and easily by using the Mac OS X application Terminal.

You can find Terminal inside the Utilities folder which is in your Applications folder. Double-click the Terminal icon and you are greeted with an austere command line interface window. Nothing fancy here—no icons, no pretty colors; just type in UNIX commands and behold the beauty of raw unbridled power. Once you have Terminal up and running, just follow these simple steps for ridding your Sony of invisible Mac files.

Step-by-Step

1. Plug your Memory Stick into your Mac, then launch Terminal.

2. Navigate to the Memory Stick by typing: cd . Before you press Return, drag the Memory Stick icon from your desktop to the Terminal window and drop it. Now, press Return and you are inside your Memory Stick at the top of its folder hierarchy structure.

3. Use the change directory command (cd) to navigate to the folder(s) with the offending invisible Mac files.

4. If, at any time, you want to see what the folder’s contents “looks” like during the course of your navigation, just use the list files/folders command and include the “all” switch. In other words, type: ls -a . This command will show you the contents of the current folder—both normal files and those cantankerous invisible Mac files.

5. Now delete those pesky varmints with the remove command (rm). This command will delete a file—immediately. So if you want to delete a .DS_Store invisible file, type this command: rm .DS_Store .

6. Use a wild card with the remove command for deleting large numbers of invisible files. A wild card is a command substitute for a specific character or group of characters. The “*” wild card is used to represent a group of characters. By using this wild card you can remove most of the invisible Mac files from within a single folder with one simple command: rm ._*.* .

7. Use the -r switch for removing invisible directories from your Sony Memory Stick. Type: rm -r directoryName for deleting any invisible Mac directories.

8. Now close Terminal, your job is done. —Dave Prochnow

2 Comments

If you have a lot of .DS_Store and ._* files to clear out that are hiding in a number of subdirectories, there's a quicker way to get them all.

Once you've cd'd to the Memory Stick (or any other similar device formatted for a non-Mac device), you can clear the litter with two lines:

find . -iname "DS_Store" | xargs rm -v
find . -iname "._*" | xargs rm -v

This should work for any collection of similar files, as long as you have write permission for them.

I use this to clean up documents consisting of lots of files and subdirectories created under MacOS X before I create .iso images for CDs and data DVDs that have to be usable by Mac, PC, Linux and Unix.

nice