Advertisement

Using files and dirs with spaces in their names.

Started by November 06, 2004 04:12 PM
3 comments, last by onthetweek 20 years, 1 month ago
Just a quick question, how do I access files and dirs in the shell when they have spaces in their names. e.g. "Program Files" Is there a character that is used instead of the ' ' character? Thanks.
Under most shells, you can just escape the space like: Program\ Files.
Advertisement
Enclosing the filename in double-quotes also works.
Free Mac Mini (I know, I'm a tool)
If you are not sure how to type the file name and and your shell supports tab-completion it can be a godsend. Just type >Progra and hit tab the shell will fill out the name with escapes and quoting as needed. If you are using bash you can hit tab twice (if the first tab does not work) to get a list of possible matches.
Thanks guys, all methods worked.

This topic is closed to new replies.

Advertisement