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.

3
  • 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 Commented May 13, 2015 at 2:16
  • ... or don't put spaces in names. Commented May 13, 2015 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. Commented May 13, 2015 at 22:36

1 Answer 1

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.

1
  • 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. Commented May 13, 2015 at 22:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.