LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   terminal navigation problem (https://www.linuxquestions.org/questions/linux-newbie-8/terminal-navigation-problem-4175428634/)

Oxyster 09-23-2012 07:21 AM

terminal navigation problem
 
Hi. I'm fairly new to using the terminal, being mainly an xp user. I decided to make the move over the linux and run all my necessary windows apps through wine a few months ago. I have got to say I love Linux.

I have a basic understanding of the terminal but when I try to access my 'Drive_c/Program files (x86)' I recieve the following error

bash: syntax error near unexpected token `('

I have no problem using Dolphin to access the files but I really want to get to grips with the terminal a bit more.

Thanks.

sycamorex 09-23-2012 07:32 AM

Hi and welcome to LQ.

It's because Linux does not usually allow a blank space in file/directory names. That's not a problem though. You just need to 'escape' it. Please type:
Code:

cd Prog[Tab]\[space][tab]\[space][tab]

segmentation_fault 09-23-2012 01:00 PM

In fact, it's not Linux's fault, it's bash. Bash uses whitespace characters (space, tab, newline) to seperate "words" and some special characters for special cases (eg parenthesis for expression evaluation order). Filenames can have such characters, but in order to access those files you need to escape those characters, as suggested by sycamorex. In bash the escape character is \ so in your case it would be:
Code:

Drive_c/Program\ files\ \(x86\)
Notice the \ escape character before every "special" character. Another alternative would be to double-quote the whole path:
Code:

$ cd "Drive_c/Program files (x86)"


All times are GMT -5. The time now is 07:43 PM.