Terminal Tips: "Uninvisible" the invisible files on your iPod

I've covered different ways to get your Music off of your iPod before, but now that I am going all nano all the time, and preparing to get rid of my 60GB iPod, I wanted a nice, quick, and easy way to get all those songs off of my old iPod. After conferring with Jay, who is much more the Unix geek than I, we figured out a method that would work. As with most things, it was happenstance that brought about the discovery. I was quizzing Jay on all the intricacies of the cp command, and had started running a basic command string to copy all the files from my iPod's invisible Music folder over to a 100GB external hard drive. I launched the Terminal (located in /Applications/Utilities/). And then I used the following command (all on one line; the break here is caused by a space in the command between the source and destination folders):

cp -R -v /Volumes/[MyiPodsName]/iPod_Control/Music /Volumes/[HardDrive]/

If you use this method, you will need to replace [MyiPodsName] with the actual name of your iPod. If there are any spaces in your iPod's name, you will have to escape them with \ (so, My iPod would need to be typed in as My\ iPod). The -R makes this command run through all the folders inside Music and the -v makes it run in verbose mode, so that all the current copying files will string by in your Terminal window.

Now the problem that I encountered while running this command is that all the copied files were still invisible. Here's where the happenstance came in to play.

Read after the jump for more...I cancelled the transfer, because I couldn't see any of the files, and Jay and I started talking about how we could make these files visible. Jay came up with a brilliant move. For this, first you must have the Developer Tools installed on your Mac. After Jay gave me this info, I went to bed and when I woke up I realized, "Why bother copying over and then making visible, when I could simply make it all visible up front and then simply drag and drop?" To do this, type in the following at the command line:

/Developer/Tools/SetFile -a v /Volumes/[MyiPodsName]/iPod_Control/Music/

This makes the Music folder visible, but the iPod_Control folder and all the folders inside the Music folder still remain invisible. So, next you must run this nearly identical command:

/Developer/Tools/SetFile -a v /Volumes/[MyiPodsName]/iPod_Control/Music/*

The * marks all the files inside the different folders inside the Music folder visible. Now, all you have to do is go back to the Terminal and type in:

open /Volumes/[MyiPodsName]/iPod_Control/

The iPod_Control folder will open up and the only files visible will be the iPod preferences file and your Music folder. Drag it over wherever you like. You could even simply drag it back into iTunes to copy all the songs off of your iPod back into your Music folder. If you ever want to turn the invisibility back on, simply run the same SetFile commands, but substitute a capitalized V for the lowercase v in the commands above. That's the visibility switch. Keep in mind, you can use this trick to "uninvisible" other invisible files on your system. Have fun!

Recommended