change directory

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

change directory

Postby gosport_gaz » Sat Apr 03, 2010 9:11 pm

Hi
Please bare with me if this is simple but I'm scratching my head.
I want to change into a directory using a shell. I type - cd the Smiths and get told that there is not a directory called 'the'. How can I change my command to make it see the full name?
:?:
Gaz
gosport_gaz
 
Posts: 3
Joined: Sat Apr 03, 2010 9:03 pm

Postby Rhakios » Sat Apr 03, 2010 9:14 pm

IME, either:
cd the\ Smiths
or
cd "the Smiths"

will do.
Bye, Rhakios
User avatar
Rhakios
Moderator
 
Posts: 7634
Joined: Wed Apr 06, 2005 11:18 pm
Location: Midlands, UK

Postby gosport_gaz » Sat Apr 03, 2010 9:25 pm

Thanks, the first works.
Gary :lol:
gosport_gaz
 
Posts: 3
Joined: Sat Apr 03, 2010 9:03 pm

Postby ajgreeny » Sat Apr 03, 2010 10:00 pm

It is always worth using a dash - or underscore _ in folder or file names in all linux distros, otherwise you have to use a \ to allow the space to be recognised, or the quotation marks.

However, the easiest way to get past that in terminal can often be to use tab to autocomplete after typing the first few letters of the pathway, but it may not always work, particularly if there are a lot of folders beginning with "The". In general, however, tab is your great friend in terminal.
Xubuntu 12.04 user, and loving it!
ajgreeny
LXF regular
 
Posts: 455
Joined: Wed May 10, 2006 8:18 pm
Location: Oxfordshire.

Postby gosport_gaz » Sun Apr 04, 2010 7:00 am

Thanks again. :lol:
gosport_gaz
 
Posts: 3
Joined: Sat Apr 03, 2010 9:03 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests