LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-13-2008, 10:16 AM   #1
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Rep: Reputation: 17
Question cannot browse directories in command promt with space in btween names


hi everybody
i know this is a completely newbie question
but i need its answer...

actually when i try to browse folders(with space in btween names eg. tom and jerry) in command prompt , the "cd" command is unable to take me to that folder.
in command prompt i got the following output ---

[pritam@localhost Desktop]$ ls
bridge
bridge2
deluge-1.0.5.tar.gz
gnome-terminal.desktop
Nirvana_-_Smells_Like_Teen_Spirit.mp3
tom and jerry
[pritam@localhost Desktop]$ cd tom and jerry
bash: cd: tom: No such file or directory





i probably know the reason.perhaps linux/unix does not support basic commands for file/folder with names containing spaces..
so what is the way to get over this problem?
plz help..
 
Old 11-13-2008, 10:16 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Put quotes around them or escape the spaces with a \
 
Old 11-13-2008, 10:21 AM   #3
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by trickykid View Post
Put quotes around them or escape the spaces with a \
thanks very much..
the first trick worked fine..
but i cannot use the second method (escape the spaces with a \)
can u illustrate this a bit?
 
Old 11-13-2008, 10:30 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Tom\and\Jerry?
 
Old 11-13-2008, 10:35 AM   #5
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Original Poster
Rep: Reputation: 17
Exclamation

Quote:
Originally Posted by brianL View Post
Tom\and\Jerry?
but that didn't work
the console output was as following ---

[pritam@localhost Desktop]$ cd tom\and\jerry
bash: cd: tomandjerry: No such file or directory
 
Old 11-13-2008, 10:39 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Code:
cd tom\ and\ jerry
You still have to put the space in there, the \ recognizes the space by escaping it.
 
Old 11-13-2008, 10:44 AM   #7
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Original Poster
Rep: Reputation: 17
oh...
thanx a lot
GOD bless u
that worked like a beauty

[pritam@localhost Desktop]$ cd tom\ and\ jerry
[pritam@localhost tom and jerry]$
 
Old 11-13-2008, 10:47 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Or use the TAB completion: digit cd tom at the command prompt, press the TAB key and the directory name will be completed with escaped spaces in place.
 
Old 11-13-2008, 10:57 AM   #9
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Original Poster
Rep: Reputation: 17
thanx....
as a newbie..i didnt know abt the TAB completion
 
  


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
how can i read pdf in command promt? hansi umayangan Linux - Software 1 09-04-2004 06:19 AM
GNOME desktop to Command promt??? AZIMBD03 Red Hat 6 03-03-2004 10:13 AM
Command Promt nerofiend Linux - Newbie 6 03-02-2004 04:55 PM
Command promt question lozz1978 Linux - Newbie 4 02-18-2004 12:02 PM
how to browse files from command promt snoop24 Linux - Newbie 2 09-15-2003 11:28 AM


All times are GMT -5. The time now is 02:10 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