Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 7 of 7

Thread: cd command?

  1. #1
    owaters's Avatar
    owaters is offline Registered User
    Join Date
    Jun 2002
    Location
    UK
    Posts
    341
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy cd command?

    How do I cd to a directory containing a space?
    For example the 'iTunes Music' directory in '/Documents/iTunes'

    I tried:

    cd Documents/iTunes/iTunes Music/

    but got the error:

    cd: Too many arguments.

  2. #2
    dafuser's Avatar
    dafuser is offline Land of Confusion
    Join Date
    Nov 2002
    Location
    Texas
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cd command?

    Originally posted by owaters
    How do I cd to a directory containing a space?
    For example the 'iTunes Music' directory in '/Documents/iTunes'

    I tried:

    cd Documents/iTunes/iTunes Music/

    but got the error:

    cd: Too many arguments.
    Try cd Documents/iTunes/iTunes*
    --
    Dafuser

    "I picked up a Magic 8-Ball the other day and it said 'Outlook not so good'. I said 'Sure, but Microsoft still ships it.'"

  3. #3
    dafuser's Avatar
    dafuser is offline Land of Confusion
    Join Date
    Nov 2002
    Location
    Texas
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cd command?

    Originally posted by owaters
    How do I cd to a directory containing a space?
    For example the 'iTunes Music' directory in '/Documents/iTunes'

    I tried:

    cd Documents/iTunes/iTunes Music/

    but got the error:

    cd: Too many arguments.
    I forgot another way

    Try cd Documents/iTunes/iTunes\ Music

    Trap the space with a "\" character. Type the \ then the space or whatever the meta character is. You can use this method to trap any meta charater in a file/directory name.

    Meta characters are the top characteres on your numeric keys like the !, @ # $ %
    --
    Dafuser

    "I picked up a Magic 8-Ball the other day and it said 'Outlook not so good'. I said 'Sure, but Microsoft still ships it.'"

  4. #4
    adambyte's Avatar
    adambyte is offline Registered User
    Join Date
    Dec 1969
    Location
    California... state of confusion
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ooh looky! Here's another way! Put the whole thing in quotations marks, like so:

    cd "Documents/iTunes/iTunes Music/"

    Yiasou.
    -Adam S ... PowerBook G4 (Mac OS X... the latest version, whatever it is, I've got it, dangit) and original iPod (iLove music, therefore iLove iPod)
    <shamelessplug>http://www.geocities.com/adambyte</shamelessplug>

  5. #5
    DMCrimson is offline Registered User
    Join Date
    Aug 2002
    Posts
    198
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you can also use tabulator to complete names of directories, files...if there are many choices, it'll stop where similarities end....or if pressed twice in that case, show all possibilities
    Sawtooth G4 @ 1.4GHz, Club3d Radeon 8500LE (full 8500 when flashed), Pioneer DVR-A05

  6. #6
    owaters's Avatar
    owaters is offline Registered User
    Join Date
    Jun 2002
    Location
    UK
    Posts
    341
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks!

    Thanks guys!

  7. #7
    Da_iMac_Daddy's Avatar
    Da_iMac_Daddy is offline Not-so-Neo-DumbA$$
    Join Date
    Sep 2002
    Location
    Dover, Delaware USA
    Posts
    423
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've had some problems with spaces in some CLI applications so now I just use an underscore ...
    Nathan Coffield
    Apple iBook;
    AMD 3400 3GB of RAM, 250GB SATA HD, 19" Wide Screen Monitor, Windows XP Home, VMWare running Slackware 11 for development purposes, Apache 2.2, PHP 5;

    Home Page

 

 

Similar Threads

  1. Safari and the command key
    By Shifting in forum Mac OS X System & Mac Software
    Replies: 4
    Last Post: June 4th, 2003, 05:49 AM
  2. Installing Unix command line tool to OSX
    By toolman in forum Unix & X11
    Replies: 5
    Last Post: March 21st, 2003, 08:09 AM
  3. Terminal script for sudo command?
    By PabloDiablo in forum Software Programming & Web Scripting
    Replies: 2
    Last Post: January 25th, 2002, 09:53 AM
  4. UNIX related things... (tr, cut, awk, and permissions)
    By simX in forum Apple News, Rumors & Discussion
    Replies: 5
    Last Post: December 19th, 2001, 02:33 AM
  5. Suspend Classic and launching from the command line
    By rsteed in forum Mac OS X System & Mac Software
    Replies: 2
    Last Post: December 4th, 2000, 04:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •