See contents of SD card in terminal window on Mac OS X

12

4

I have photos on my SD Card. I can not see the files on my Mac. I can see it in my camera and when I load the micro SD card in phone, I can see the pics. My Mac is not showing any files. I am assuming there could be some kind of virus that had made the files hidden.

I want to see these files in Terminal (just like I would do in DOS).

hk_

Posted 2012-03-12T02:24:35.407

Reputation: 1 878

cd to the card and then ls -al? (I don't know if OSX has 'hidden' files - on Linux and BSD, a file is hidden if the filename starts with a '.' character.) – user55325 – 2012-03-12T02:36:53.533

my card name is "phone card" but cd "phone card" does not work – hk_ – 2012-03-12T02:58:57.257

4You have to be in the directory where the OS mounts it - in OS X it's probably /Volumes, so you would need to cd "/Volumes/phone card" (or cd /Volumes/phone\ card). – user55325 – 2012-03-12T03:10:07.657

@user55325, that works, you can post it as answer. And extra help would be, how do I copy files from my SD card to my mac drive, lesser say documents folder. Thanks – hk_ – 2012-03-12T04:58:17.170

Answers

13

To list the contents of the card, first cd /Volumes/<card name> - in this case cd /Volumes/phone\ card (the \ escapes the space). Then you can do ls -al to list the files (hidden and visible) on the card.

If you want to copy files to somewhere else on the drive, you can use cp. For example, to copy files to your home directory, cp <some file> ~ (or to copy everything, cp -R ./* ~, where * means "match any character(s)" and ~ is short for your home directory (I don't remember the OS X default directory hierarchy). -R means copy directories recursively (if cp encounters a directory, it should copy the contents of the directory as well).

man cp will tell you more about cp (or any other command).

user55325

Posted 2012-03-12T02:24:35.407

Reputation: 4 693