Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do i change into the directory of my thumbdrive? I've been poking around and see that this command, "diskutil list", lists all my local disks. That produces this..

David-Adamss-MacBook-Pro:~ davidadams$ diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            249.7 GB   disk0s2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.0 GB     disk3
   1:                 DOS_FAT_32 THUMBDRIVE              4.0 GB     disk3s1

now i see that my thumbdrive is showing up in /dev/disk3 but i can't get to it. I can cd into /dev but thats as far as i can get.

"cd /dev/disk3/THUMBDRIVE" tells me "-bash: cd: /dev/disk3/THUMBDRIVE: Not a directory"

any help would be great.

share|improve this question

migrated from Jun 30 '11 at 3:04

This question came from our site for professional and enthusiast programmers.

linux or mac? your prompt says mac, so I changed the tags – loosecannon Jun 30 '11 at 2:44
up vote 35 down vote accepted
# cd /Volumes && ls

It will show you the directory location of all mounted volumes. Then just cd into the drive you want.

share|improve this answer

Mac OS X mounts drives automatically under /Volumes.

mress:10042 Z$ diskutil list
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS mress HD                999.9 GB   disk0s2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *1.0 TB     disk1
   1:        Apple_partition_map                         32.3 KB    disk1s1
   2:                  Apple_HFS mress™                  1.0 TB     disk1s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.5 TB     disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                  Apple_HFS Development             512.2 GB   disk2s2
   3:                  Apple_HFS Media                   987.7 GB   disk2s3
mress:10043 Z$ ls /Volumes
Development/ Media/       mress HD@    mress™/

You'll notice the directories match the NAME column.

share|improve this answer
thanks! i got it with this "cd /volumes/thumbdrive" – David Jun 30 '11 at 3:30

If you drag and drop the icon corresponding to the volume on the USB drive from the Desktop (or Finder) into the Terminal window, it will automatically paste the path where that volume is mounted. This will most likely be a path in /Volumes.

share|improve this answer

In Terminal, if you

ls /Volumes

you'll see all of your drives. You can then cd to one of them (or just cd directly - no need to list the volumes first). For example:

cd /Volumes/My\ Other\ Drive

Spaces are replaced by '\ '. Or you can put the whole thing in quotes:

cd /Volumes/"My Other Drive"

If the drive name has no spaces, then you'd just use the name:

cd /Volumes/MyOtherDrive
share|improve this answer

ypuou have to mount it first.

#mkdir /media/myusbstick
#mount /dev/disk3 /media/myusbstick
# cd /media/myusbstick

make a directory, then mount then cd into it

You need to be root to do this, there are ways to set it up so users can mount like common GUI's do, but that is beyond me

EDIT: sorry you tagged your post with linux,?? but you have a mac? This is for linux, if you were curious

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .