3

I have a question about using the terminal in ubuntu 11.04.I have installed wine and steam and civ III thru steam.According to instructions on wine forum in order to play civ some font files need to be moved within the wine folder which i have done but it also informs to do the following:

then open a console and browse to:
.wine/dosdevices/c:/Program Files/Steam/steamapps/common/sid meier's civilization iii complete/Conquests/

and type the following command:
sudo chown root LSANS.*

when I open the terminal I am able to change directory to .wine/dosdevices/c but when I try to change to the next "program files" I get message in terminal not found. I type in ls command and does list "program files" why am I NOT able to change to directory "program files"

below is actual steps in terminal i have done

mike@ubuntu:~$ cd .wine
mike@ubuntu:~/.wine$ cd dosdevices
mike@ubuntu:~/.wine/dosdevices$ cd c:
mike@ubuntu:~/.wine/dosdevices/c:$ ls
Program Files  users  windows
mike@ubuntu:~/.wine/dosdevices/c:$ cd program files
bash: cd: program: No such file or directory
mike@ubuntu:~/.wine/dosdevices/c:$

I also tried capitalize

Caesium
  • 15,807

4 Answers4

7

Arguments in the shell are are separated using spaces. This means that whenever you run a command and try to pass a file or a directory as an argument that contains a space in it, bash assumes it is two separate arguments. There are many ways to specify this. You can use what is called an escape character to signal that the space is part of the argument. To do this, just insert a \ before the space in the file name

cd Program\ Files

or you can use quotes to signal that it is a single parameter

cd "Program Files"

However, often you will not need to type the whole thing if you use the Tab Completion feature

cd P<TAB>

If there are multiple files starting with P, add another alphabet and press tab again to complete.

ste_kwr
  • 11,210
2

You need to quote any directory/file name which has spaces in, or it gets confused. Try this:

cd "Program Files"

Also, you can tab-complete, so you can also try:

cd "Progr<press TAB>

and it ought to fill the rest in for you.

Caesium
  • 15,807
1

As an add-on, if you want to access 'Program Files (x86)', use apostrophes for the special characters like this:

cd Program\ Files\ '('x86')'
Eliah Kagan
  • 117,780
Nisarg
  • 11
  • 1
    Or just enclose the entire thing in double quotes. cd "Program Files (x86)" Shell variables are expanded in double quotes, so most filenames containing unescaped $ signs will do the wrong thing in double quotes, but for this and most situations, double quotes are the most elegant and least error-prone way to quote a string that contains spaces and parentheses (and even single quotes / apostrophes) but no double quotes. – Eliah Kagan Oct 11 '12 at 11:28
0

First I want to say that I love the Command Line Interface (CLI) and there are a ton of free resources on it. As you dive into the directory and according to what you are getting stuck on...you will want to type 'cd “Program Files” and then tap enter. You want to make sure that spelling is correct as the CLI sees files exactly how you type them. File1 is different from file1.

Someone mentioned the (TAB) key and this is awesome especially when you have a ton of info to type for a file name, etc.. Next time you're in the terminal and you've dug past the hidden wine folder try typing cd dos(then TAB). Chances are it will automatically fill in your dosdevices portion saving you valuable time.

A valuable CLI book for me is The Linux Command Line by William E. Shotts, Jr. and you can download the book for free!