LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   file not found error when using folder names with 2 words (https://www.linuxquestions.org/questions/suse-opensuse-60/file-not-found-error-when-using-folder-names-with-2-words-574207/)

sirius57 08-02-2007 08:45 AM

file not found error when using folder names with 2 words
 
I have a frustrating problem changing directories or executing commands in a terminal window. I can not use a path when executing a command if a folder name is made up of two seperate words with a space between them. I have to manually use cd to drill down folder by folder. If a folder name is two words, then I have to use the wildcard *. Example: to do 'cd mp3 files', I would have to use 'cd mp*' and my shell path would drill down to mp3 files. If I do not use a wildcard, I would get a file not found error. I am using suse 10.0.

theNbomr 08-02-2007 09:07 AM

You can get around this in either of at least two ways:
1. Enclose the file/directory name in single or double quotes. THis makes the shell see it as a single argument, instead of multiple arguments.
2. Escape each whitespace character by prefixing it with a '\' backslash character. This tells the shell to not use it as a delimiter between arguments.
--- rod.

bneal 08-02-2007 09:09 AM

I find it good practice to use and underscore "_" instead of spaces but if this is from an existing partition or drive that was setup in windows if you don't want to rename all the directories try this
example from computer
to access
Quote:

/mnt/windows/documents and settings
I have to type
Quote:

cd /mnt/windows/documents\ and\ settings
tab completion works as well, at least it does for me, so most of the time it's just
Quote:

cd /mnt/windows/documents(tab)
this auto completes with
Quote:

cd /mnt/windows/documents\ and\ settings

sirius57 08-02-2007 09:58 AM

Ok, I will try those examples. I have a similar problem with crossover office. When I try to open outlook, it can not find the 'welcome.msg' and so it will not run. I could try the '_' underscore between 'program files' in my wine directory?

theNbomr 08-02-2007 11:07 AM

Quote:

Originally Posted by sirius57
I could try the '_' underscore between 'program files' in my wine directory?

I think bneal means to use underscores instead of whitespace when creating the file names. You cannot just refer to a file by name, substituting existing whitespace with underscores.
Hope that clarifies things.
--- rod.


All times are GMT -5. The time now is 10:51 PM.