LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-01-2004, 09:53 AM   #1
windefault
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Rep: Reputation: 15
How to change directory


i want to change directory to 'gtk in my CD',how can i do that?

the file name contain space.


[root@localhost root]# cd gtk
[root@localhost gtk]# ls -la
total 12
drwxr-xr-x 3 root root 4096 Nov 1 23:49 .
drwxr-x--- 33 root root 4096 Nov 1 23:48 ..
drwxr-xr-x 2 root root 4096 Nov 1 23:49 gtk in my CD
[root@localhost gtk]# cd gtk in my CD
bash: cd: gtk: No such file or directory
[root@localhost gtk]# cd gtkinm~1
bash: cd: gtkinm~1: No such file or directory
[root@localhost gtk]# cd gtk~1
bash: cd: gtk~1: No such file or directory
[root@localhost gtk]#

thx a lot
 
Old 11-01-2004, 10:01 AM   #2
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
try using tab completion,

For a proper answer, it's to do with the fact that you need to put \ before spaces, else the command line interpreter doesn't realise it's all one argument.
 
Old 11-01-2004, 10:09 AM   #3
windefault
LQ Newbie
 
Registered: Sep 2004
Posts: 25

Original Poster
Rep: Reputation: 15
thx

i get it


[root@localhost gtk]# ls
gtk in my CD
[root@localhost gtk]# cd gtk\ in\ my\ CD/
[root@localhost gtk in my CD]# cd gtk\ in\ my\ CD
bash: cd: gtk in my CD: No such file or directory
[root@localhost gtk in my CD]#
[root@localhost gtk in my CD]#


why should we put a / at the end?
 
Old 11-01-2004, 10:47 AM   #4
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
notice after the first time you're /in/ gtk in my CD so that's why the command isn't working.
 
Old 11-01-2004, 11:53 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Also: I couldn't help but notice you're doing this:
Code:
[root@localhost gtk]# cd gtkinm~1
bash: cd: gtkinm~1: No such file or directory
[root@localhost gtk]# cd gtk~1
bash: cd: gtk~1: No such file or directory
The ~1 is DOS - In linux, use an *
this would've worked:
Code:
# cd gtk*CD
without a hitch.
 
Old 11-02-2004, 04:28 AM   #6
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
or u could type:
cd "gtk in my CD"
 
  


Reply



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 to change to the config directory brianbritz Linux - General 1 10-20-2005 10:00 PM
cant change directory permission? dwarf007 Linux - General 1 09-24-2004 09:35 AM
How to change directory? bngrhl Linux - Newbie 5 05-16-2004 01:20 AM
script to change directory trout21 Linux - Newbie 9 02-17-2004 12:49 PM
mountig - change ro to rw, delete directory, change rw to ro ?? itsjustme Linux - General 6 10-17-2003 11:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:21 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
Open Source Consulting | Domain Registration