2

I am fairly new to Linux and have been trying to move some files around with terminal on my external hard drive but I can't seem to get it to work. I am using a generic external hard drive with a ext4 format but not matter what I try I can't do anything with it through my terminal. The Drive's name does have spaces in it so when ever I do something in terminal it tries to separate the externals name and the spits out no directory found. is there a way to make it recognize the name without removing the spaces? Any help would be more than grateful.

  • 1
    You can either quote the name of the drive: /media/'name of my drive' or use backslashes to escape the spaces: /media/name\ of\ my\ drive – jasonwryan May 13 '15 at 2:16
  • ... or don't put spaces in names. – Ricky Beam May 13 '15 at 5:29
  • lol well i had named the drive before i started using linux and i have been using that drive for years so i would hate to change its name now just because of this. but thank you so much for your help. – Ferothin May 13 '15 at 22:36
2

Welcome to Linux! A trick that will get you started here (and will save you from getting carpal tunnel in the future) is "tab completion":

$ ls /med

then press Tab to see

$ ls /media/

If you press Tab again, you might see a list of possible options to continue the path,

$ ls /media/
MyBigExternalDrive/    My Example Hard Drive/

or (if there is only one path) the entire path will be completed:

$ ls /media/My\ Example\ Hard\ Drive/

Tricks like this are nice because you can learn seemingly unrelated syntax. In this case, you can write out paths with spaces by putting a \ in front of the space.

  • Oh wow. thank you so much i never knew about this miricle called tab complete. that should shorten how much i have to type quite alot. – Ferothin May 13 '15 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.