Terminal – Fix ls/cd Commands Not Finding Files on External Hard Drive

finderhard drivemacosterminal

I'm having a bit of trouble with my external hdd and terminal. I've been able to access files on it via terminal in the past, but since I upgraded to El Capitan I can't seem to find anything on my external hdd. I can navigate through it and use stuff from it fine using Finder.

can see things fine using finder

But then when I try to find anything using Terminal:

terminal

I'm really confused here — this has never happened before. Any ideas?

edit: did ls -l /Volumes:

lrwxr-xr-x   1 root  admin    1 Oct  4 22:05 Macintosh HD -> /
drwx------+  2 Shan  admin   68 Oct 11 17:29 ShanStore
drwxrwxr-x  17 Shan  staff  646 Oct 29 21:41 ShanStore 1

Not sure why it's showing two external hdds — I only have the one

Best Answer

For whatever reason, the drive got mounted/attached under /Volumes/ShanStore 1. The number will not be shown in Finder but bash (in Terminal) is a bit more strict here.

To fix:

  • Unmount/eject the drive in Finder und shut down the drive
  • Run sudo rmdir /Volumes/ShanStore /Volumes/ShanStore\ 1 (you'll probably get an error message about a non-existing /Volumes/ShanStore\ 1, which is ok)
  • Run ls -l /Volumes to (hopefully) see /Volumes/ShanStore gone
  • Restart the drive again
Related Question