LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2012, 12:04 AM   #1
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Rep: Reputation: Disabled
Unhappy How to enter directory which contains blank?


Hello everyone here.

I encountered a problem when using Ubuntu, that is how to enter directory which contains blank.
For example:
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# ls
fw lichee-4.0.3r1-a10-v1.4rc3.tar lichee-4.0.3r1-a13-v1.4rc3 open source code Open source code.rar PX-8805 firmware updating
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd "Open source code"
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd Open\ source\ code
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd 'Open\ source\ code'
bash: cd: Open\ source\ code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd 'Open source code'
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# file Open\ source\ code
Open source code: ERROR: cannot open `Open source code' (No such file or directory)
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# ls -la
total 1451344
drwxr-xr-x 6 root root 4096 Nov 7 07:53 .
drwxrwxrwx 3 root root 4096 Nov 7 07:12 ..
drwxr-xr-x 3 root root 4096 Nov 7 07:39 fw
-rw-r--r-- 1 root root 1486069760 May 29 05:34 lichee-4.0.3r1-a10-v1.4rc3.tar
drwxrwxr-x 6 502 502 4096 May 29 06:08 lichee-4.0.3r1-a13-v1.4rc3
drwxr-xr-x 8 root root 4096 Jul 16 16:06 open source code
-rw-r--r-- 1 root root 73907 Jul 16 12:26 Open source code.rar
drwxr-xr-x 3 root root 4096 Sep 18 13:23 PX-8805 firmware updating
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805#
I have ever used Suse Linux, as I remember, without such problem,

Can anyone help me out? Thankk you very much

Last edited by chinabenjamin66; 11-07-2012 at 12:17 AM. Reason: Sorry disturbing, I misprinted. pleas
 
Old 11-07-2012, 12:17 AM   #2
chinabenjamin66
Member
 
Registered: Mar 2012
Location: Shenzhen Chian
Posts: 73

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chinabenjamin66 View Post
Hello everyone here.

I encountered a problem when using Ubuntu, that is how to enter directory which contains blank.
For example:
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# ls
fw lichee-4.0.3r1-a10-v1.4rc3.tar lichee-4.0.3r1-a13-v1.4rc3 open source code Open source code.rar PX-8805 firmware updating
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd "Open source code"
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd Open\ source\ code
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd 'Open\ source\ code'
bash: cd: Open\ source\ code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# cd 'Open source code'
bash: cd: Open source code: No such file or directory
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# file Open\ source\ code
Open source code: ERROR: cannot open `Open source code' (No such file or directory)
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805# ls -la
total 1451344
drwxr-xr-x 6 root root 4096 Nov 7 07:53 .
drwxrwxrwx 3 root root 4096 Nov 7 07:12 ..
drwxr-xr-x 3 root root 4096 Nov 7 07:39 fw
-rw-r--r-- 1 root root 1486069760 May 29 05:34 lichee-4.0.3r1-a10-v1.4rc3.tar
drwxrwxr-x 6 502 502 4096 May 29 06:08 lichee-4.0.3r1-a13-v1.4rc3
drwxr-xr-x 8 root root 4096 Jul 16 16:06 open source code
-rw-r--r-- 1 root root 73907 Jul 16 12:26 Open source code.rar
drwxr-xr-x 3 root root 4096 Sep 18 13:23 PX-8805 firmware updating
root@gpl-vm:/GPL/test/ufsd/pearl/PX-8805/Sourcecode_PX-8805#
I have ever used Suse Linux, as I remember, without such problem,

Can anyone help me out? Thankk you very much
This problem has been resolved.
 
Old 11-07-2012, 04:47 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Here filenames are in multiple words containing spaces, so you can use " " to hold a filename that has spaces, like this.
Code:
cd "Open source file"
Please mark the thread a solved if there's no more issue.
 
Old 11-07-2012, 02:04 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
It's also generally polite to post the actual solution that worked for you, so as to help anyone who comes across the thread in the future. It appears that you forgot that *nix filenames are case-sensitive, correct?

But to supply a bit more background detail, read the following links for an explanation of exactly how the shell handles arguments and whitespace. It's a vitally important concept to understand correctly.

http://mywiki.wooledge.org/Arguments
http://mywiki.wooledge.org/WordSplitting
http://mywiki.wooledge.org/Quotes

In any case, this kind of thing can usually be solved with tab completion. Type the first few letters of the file or directory name (enough to match it uniquely), hit the tab key, and the shell will insert the rest of it for you, properly escaped for use.


PS: Please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot enter home directory. Using /. sfzombie13 Linux - Newbie 4 02-26-2012 11:33 AM
How to enter network directory from console? Mr. Alex Linux - Networking 2 06-05-2010 02:37 PM
Cannot enter NTFS partition directory Metal Martian Linux - Newbie 5 03-08-2004 07:29 PM
Could not enter directory mnt/cdrom mgbgt Linux - Newbie 5 06-17-2003 07:50 PM
I did the following program and get blank line after pressing <ENTER> purpleburple Programming 5 08-21-2002 12:00 PM


All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration