Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to force myself to use folder/file names without spaces etc. so I'm 100% certain I can open and run them from the command line.

Some terminal apps which I use frequently hava a hard time recognisizing filenames that have spaces in them, and I want to prevent having to type \ every time.

Is there a way of forcing this (perhaps formatting my hdd in to a different file system)?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Unfortunately, you just have to remember to do it each time you make a file or directory. There's no way you can do this via software tools or by formatting to a particular file system. After the fact you can use software to convert spaces to '.' or '-' however.

Obviously what you describe is an excellent idea and good practice when working in a *nix environment. You'll probably find that the more time you spend in the Terminal, the more inclined you'll be to create short, non-spaced file names. Unfortunately Apple themselves make your task an impossible one in that they often use multi-word file or directory names.

As to the first part of your question: You can be sure that you'll always be able to manipulate files in the Terminal, even if they contain many spaces, etc. It's just a case of 'escaping' the spaces by typing a '\ ' where the space would be, as you point out.

Tab-completion can be a real time saver here, but it's generally better to avoid the problem in the first place.

share|improve this answer
    
Okay, too bad.. was just wondering –  romeovs Apr 27 '11 at 19:55

You can put the whole path in singlequotes:

$ cd '/User Guides And Information/Welcome to Snow Leopard.app/'

Tab-completion even works properly inside a quoted path string.

But as @boehj says, there's no way to make spaces into non-troublemakers on an OS leve.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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